diff --git a/packages/esm-commons-lib/src/utils/schema-manipulation.ts b/packages/esm-commons-lib/src/utils/schema-manipulation.ts index 32d2f2a71..a1c7f07be 100644 --- a/packages/esm-commons-lib/src/utils/schema-manipulation.ts +++ b/packages/esm-commons-lib/src/utils/schema-manipulation.ts @@ -1,7 +1,10 @@ export function extractSchemaValues(schema) { const result = {}; function traverse(obj) { - Object.entries(obj).forEach(([key, value]) => { + if (obj === null || obj === undefined || typeof obj !== 'object') { + return; + } + Object.entries(obj)?.forEach(([key, value]) => { if (value !== undefined && value !== null) { if (typeof value === 'object' && !Array.isArray(value)) { traverse(value);