Fixing an issue detected by tests.

This commit is contained in:
mike12345567 2024-06-24 13:30:18 +01:00
parent 75cee3c4fd
commit b597bd3dbe
1 changed files with 5 additions and 2 deletions

View File

@ -18,12 +18,15 @@ import { builderSocket } from "../../../websockets"
import { inputProcessing } from "../../../utilities/rowProcessor"
function getDatasourceId(table: Table) {
if (!table || !table._id) {
throw new Error("No table/table ID supplied")
if (!table) {
throw new Error("No table supplied")
}
if (table.sourceId) {
return table.sourceId
}
if (!table._id) {
throw new Error("No table ID supplied")
}
return breakExternalTableId(table._id).datasourceId
}