Skip to content

Commit

Permalink
Tree: fix insertChild (ElemeFE#21194)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 authored and cn3lfs committed Feb 24, 2022
1 parent 67116f2 commit 4f2afcf
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 4f2afcf

Please sign in to comment.