diff --git a/packages/builder/src/components/design/settings/controls/DataSourceSelect/DataSourceSelect.svelte b/packages/builder/src/components/design/settings/controls/DataSourceSelect/DataSourceSelect.svelte index 9eef8c1c06..e79ed75d76 100644 --- a/packages/builder/src/components/design/settings/controls/DataSourceSelect/DataSourceSelect.svelte +++ b/packages/builder/src/components/design/settings/controls/DataSourceSelect/DataSourceSelect.svelte @@ -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 }