fix: ensure extract always return an array

This commit is contained in:
Nybkox
2025-01-23 12:20:55 +01:00
parent 0d3e39c479
commit abf5227b47

View File

@@ -297,10 +297,12 @@ export class SqlGenerator {
}
extract(objectTypeField) {
return this.dbinfo[objectTypeField].filter(x =>
this.objects.find(
y => x.pureName == y.pureName && x.schemaName == y.schemaName && y.objectTypeField == objectTypeField
)
return (
this.dbinfo[objectTypeField]?.filter(x =>
this.objects.find(
y => x.pureName == y.pureName && x.schemaName == y.schemaName && y.objectTypeField == objectTypeField
)
) ?? []
);
}