handle cases where datasourceName is undefined when sorting datasources
This commit is contained in:
parent
e790a04228
commit
997daf17d0
|
@ -56,7 +56,10 @@
|
||||||
.map(table => format.table(table, $datasources.list))
|
.map(table => format.table(table, $datasources.list))
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
// sort tables alphabetically, grouped by datasource
|
// 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) {
|
if (dsComparison !== 0) {
|
||||||
return dsComparison
|
return dsComparison
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue