Commit 4d7d24b2 authored by 好多大米's avatar 好多大米 Committed by GitHub

Tree: fix insertChild (#21194)

parent 49438673
...@@ -220,7 +220,7 @@ export default class Node { ...@@ -220,7 +220,7 @@ export default class Node {
if (!(child instanceof Node)) { if (!(child instanceof Node)) {
if (!batch) { if (!batch) {
const children = this.getChildren(true); const children = this.getChildren(true) || [];
if (children.indexOf(child.data) === -1) { if (children.indexOf(child.data) === -1) {
if (typeof index === 'undefined' || index < 0) { if (typeof index === 'undefined' || index < 0) {
children.push(child.data); children.push(child.data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment