Skip to content

Commit

Permalink
Merge pull request #15140 from Budibase/datasource-sorting-fix
Browse files Browse the repository at this point in the history
handle cases where datasourceName is undefined when sorting datasources
  • Loading branch information
andz-bb authored Dec 9, 2024
2 parents e790a04 + 997daf1 commit d725d49
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d725d49

Please sign in to comment.