Skip to content

Commit 4d7d24b

Browse files
authored
Tree: fix insertChild (#21194)
1 parent 4943867 commit 4d7d24b

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)