diff --git a/addons/docs/src/frameworks/ember/jsondoc.js b/addons/docs/src/frameworks/ember/jsondoc.js index 307f8c35bc6..c9d95fedac6 100644 --- a/addons/docs/src/frameworks/ember/jsondoc.js +++ b/addons/docs/src/frameworks/ember/jsondoc.js @@ -10,7 +10,14 @@ export const getJSONDoc = () => { export const extractArgTypes = (componentName) => { const json = getJSONDoc(); + if (!(json && json.included)) { + return null; + } const componentDoc = json.included.find((doc) => doc.attributes.name === componentName); + + if (!componentDoc) { + return null; + } const rows = componentDoc.attributes.arguments.map((prop) => { return { name: prop.name, @@ -29,10 +36,13 @@ export const extractArgTypes = (componentName) => { export const extractComponentDescription = (componentName) => { const json = getJSONDoc(); + if (!(json && json.included)) { + return null; + } const componentDoc = json.included.find((doc) => doc.attributes.name === componentName); if (!componentDoc) { - return ''; + return null; } return componentDoc.attributes.description;