Skip to content

Commit

Permalink
Tree: fix insertChild (#21194)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 committed Aug 2, 2021
1 parent 4943867 commit 4d7d24b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tree/src/model/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default class Node {

if (!(child instanceof Node)) {
if (!batch) {
const children = this.getChildren(true);
const children = this.getChildren(true) || [];
if (children.indexOf(child.data) === -1) {
if (typeof index === 'undefined' || index < 0) {
children.push(child.data);
Expand Down

0 comments on commit 4d7d24b

Please sign in to comment.