Merge pull request #1011 from dbgate/feature/null-safety-to-sql-generator

fix: ensure extract always return an array
This commit is contained in:
Jan Prochazka
2025-01-23 15:09:23 +01:00
committed by GitHub

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
)
) ?? []
);
}