Skip to content

Commit

Permalink
Tree: fix insertChild
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 committed Jul 30, 2021
1 parent 4943867 commit 5516bdb
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 5516bdb

Please sign in to comment.