Skip to content

Commit 14361bc

Browse files
committed
fix: handle null properties in _jsonExampleFromProperties method to prevent errors
1 parent 5d782d8 commit 14361bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ExampleGenerator.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,9 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
13961396
*/
13971397
_jsonExampleFromProperties(properties) {
13981398
const result = {};
1399+
if (!properties) {
1400+
return result;
1401+
}
13991402
for (let i = 0, len = properties.length; i < len; i++) {
14001403
const property = properties[i];
14011404
const name = this._getValue(property, this.ns.w3.shacl.name);

0 commit comments

Comments
 (0)