Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
fix: never iterate over undefined children
Browse files Browse the repository at this point in the history
  • Loading branch information
vhf committed Oct 28, 2019
1 parent 83ffd7c commit 5f3be8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/Class.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export function proposalDataset (clss, validation = true) {
const ontology = new Dataset().addAll(quads)
const structure = new Dataset().addAll(structureQuads)

return clss.propChildren.reduce((acc, propChild) => {
return (clss.propChildren || []).reduce((acc, propChild) => {
const childDatasets = propToDataset(propChild, validation)

const ontology = acc.ontology.merge(childDatasets.ontology)
Expand Down
2 changes: 1 addition & 1 deletion models/Property.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export function proposalDataset (property, validation = true) {
const ontology = new Dataset().addAll(quads)
const structure = new Dataset()

return property.classChildren.reduce((acc, classChild) => {
return (property.classChildren || []).reduce((acc, classChild) => {
const childDatasets = classToDataset(classChild, validation)

const ontology = acc.ontology.merge(childDatasets.ontology)
Expand Down

0 comments on commit 5f3be8f

Please sign in to comment.