Skip to content

Commit e451e40

Browse files
author
Thomas Lacroix
committed
[bugfix](Hover): Fix the hover errors
1 parent 947b003 commit e451e40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/tree-data-utils.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ function addNodeAtDepthAndIndex({
610610
}
611611

612612
// If the current position is the only possible place to add, add it
613-
if (currentIndex >= minimumTreeIndex - 1 || (isLastChild && !node.children)) {
613+
if (currentIndex >= minimumTreeIndex - 1
614+
|| (isLastChild && !(node.children && node.children.length))) {
614615
if (typeof node.children === 'function') {
615616
throw new Error('Cannot add to children defined by a function');
616617
} else {

0 commit comments

Comments
 (0)