Skip to content

Commit 160a798

Browse files
authored
fix: prevent page broken via folderTree (#358)
1 parent 9dd5e4a commit 160a798

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/helper.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class TreeViewUtil<T extends BaseProps> implements ITreeInterface<T> {
127127
const parentIndex = this.getIndex(index.parent!);
128128
const parentNode = this.get(index.parent!);
129129

130-
if (parentNode && parentIndex) {
130+
if (parentNode && parentIndex && parentIndex[this.childNodeName]) {
131131
parentNode[this.childNodeName].splice(
132132
parentNode[this.childNodeName].indexOf(node),
133133
1
@@ -167,7 +167,7 @@ export class TreeViewUtil<T extends BaseProps> implements ITreeInterface<T> {
167167
return null;
168168
}
169169

170-
updateChildren(children: IIndex<T>) {
170+
updateChildren(children: IIndex<T> = []) {
171171
const self = this;
172172
children.forEach(function (id, i) {
173173
const index = self.getIndex(id);

0 commit comments

Comments
 (0)