diff --git a/src/util.js b/src/util.js index 0a4075ce..dfb7579c 100644 --- a/src/util.js +++ b/src/util.js @@ -164,6 +164,9 @@ export function flatToHierarchy(arr) { const hierarchyNodes = []; const levelObj = {}; arr.forEach((item) => { + if (!item.pos) { + return; + } const posLen = item.pos.split('-').length; if (!levelObj[posLen]) { levelObj[posLen] = [];