diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index f4f69b6..efdb49a 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -63,7 +63,9 @@ class NodeItem implements Node { ) { this.data = data; this.name = name; - this.parent = parent; + if (parent != null) { + setParent(parent); + } this.children.addAll(children); }