handle cases where datasourceName is undefined when sorting datasources

This commit is contained in:
andz-bb 2024-12-09 10:29:37 +00:00
parent e790a04228
commit 997daf17d0
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@
.map(table => format.table(table, $datasources.list))
.sort((a, b) => {
// sort tables alphabetically, grouped by datasource
const dsComparison = a.datasourceName.localeCompare(b.datasourceName)
const dsA = a.datasourceName ?? ""
const dsB = b.datasourceName ?? ""
const dsComparison = dsA.localeCompare(dsB)
if (dsComparison !== 0) {
return dsComparison
}