Skip to content

Commit 6c47d2b

Browse files
committed
Ignore updating parent tree if it doesn't exist.
1 parent eab6354 commit 6c47d2b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/middlewares/parsers/schema.preprocessor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ export class SchemaPreprocessor {
235235
}
236236
const prop = path?.[path?.length - 1];
237237
const required = parent?.required ?? [];
238+
if (!parent) {
239+
return;
240+
}
238241
parent.required = required.filter(p => p !== prop);
239242
if (parent.required.length === 0) {
240243
delete parent.required;

0 commit comments

Comments
 (0)