diff --git a/src/shared/buildHierarchy.js b/src/shared/buildHierarchy.js index 2fb3244..d872d1b 100644 --- a/src/shared/buildHierarchy.js +++ b/src/shared/buildHierarchy.js @@ -65,6 +65,9 @@ function getFile(module, fileName, parentTree) { getFile(module, fileName.slice(charIndex + 1), childFolder); } else { module.name = fileName; + if (!parentTree.children) { + parentTree.children = []; + } parentTree.children.push(module); } }