Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit 60702ca

Browse files
cs1707CarterLi
authored andcommitted
Tree: fix insertChild (ElemeFE#21194)
1 parent 95b0598 commit 60702ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/tree/src/model/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export default class Node {
220220

221221
if (!(child instanceof Node)) {
222222
if (!batch) {
223-
const children = this.getChildren(true);
223+
const children = this.getChildren(true) || [];
224224
if (children.indexOf(child.data) === -1) {
225225
if (typeof index === 'undefined' || index < 0) {
226226
children.push(child.data);

0 commit comments

Comments
 (0)