Skip to content
Permalink
Browse files

fix(cf-navigation): add minor safety checks (#217)

  • Loading branch information...
czosel committed May 8, 2019
1 parent ed6b922 commit cf3ca9e5752a1dbe035e3bea874033a98d7d2144
Showing with 4 additions and 2 deletions.
  1. +4 −2 addon/components/cf-navigation.js
@@ -76,12 +76,14 @@ export default Component.extend(ComponentQueryManager, {
fields: computed("rootDocument", function() {
const isFormQuestion = field =>
field.question.__typename === "FormQuestion";
return (this.get("rootDocument.fields") || [])
return this.getWithDefault("rootDocument.fields", [])
.filter(isFormQuestion)
.map(field => {
field.set(
"navSubFields",
field.childDocument.fields.filter(isFormQuestion)
field
.getWithDefault("childDocument.fields", [])
.filter(isFormQuestion)
);
return field;
});

0 comments on commit cf3ca9e

Please sign in to comment.
You can’t perform that action at this time.