Skip to content

Commit

Permalink
fix: 🐛 prevent read properties of null
Browse files Browse the repository at this point in the history
"Cannot read properties of null (reading 'writeOnly')"
  • Loading branch information
Morgbn committed Oct 10, 2023
1 parent 9cedb38 commit e47a8a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/plugins/oaSchema.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ delete schema.userstamps
if (!schema.writeOnly) {
const stack = []
const addToStack = parent => Object.entries(parent).forEach(([key, el]) =>
typeof el === 'object' ? stack.push({ key, parent, el }) : 0)
(el && typeof el === 'object') ? stack.push({ key, parent, el }) : 0)
addToStack(schema)
while(stack.length) {
const { parent, key, el } = stack.pop()
Expand Down

0 comments on commit e47a8a2

Please sign in to comment.