Skip to content

Commit

Permalink
fix(markdownbuilder): guard against empty definitions object
Browse files Browse the repository at this point in the history
prevents a crashing bug for some schemas

fixes #334
  • Loading branch information
trieloff committed Aug 12, 2021
1 parent 5d04ec0 commit f1b90c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/markdownBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ function build({
];
}))),
...flist(flat(Object.entries(patternProperties || {}).map(([name, definition]) => {
const description = definition[s.meta].longdescription || paragraph(text(i18n`no description`));
const description = definition[s.meta] && definition[s.meta].longdescription ? definition[s.meta].longdescription : paragraph(text(i18n`no description`));

return [
heading(level + 1, [text(i18n`Pattern: `), inlineCode(name)]),
Expand Down

0 comments on commit f1b90c2

Please sign in to comment.