diff --git a/src/services/helper.ts b/src/services/helper.ts index 135a9859f..482d16c12 100644 --- a/src/services/helper.ts +++ b/src/services/helper.ts @@ -127,7 +127,7 @@ export class TreeViewUtil implements ITreeInterface { const parentIndex = this.getIndex(index.parent!); const parentNode = this.get(index.parent!); - if (parentNode && parentIndex) { + if (parentNode && parentIndex && parentIndex[this.childNodeName]) { parentNode[this.childNodeName].splice( parentNode[this.childNodeName].indexOf(node), 1 @@ -167,7 +167,7 @@ export class TreeViewUtil implements ITreeInterface { return null; } - updateChildren(children: IIndex) { + updateChildren(children: IIndex = []) { const self = this; children.forEach(function (id, i) { const index = self.getIndex(id);