From ff3a45665798fdad0344d7e891e1e812367e1e01 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 20 Sep 2016 22:40:32 +0100 Subject: [PATCH] NodeItem: new constructor sets parent properly --- src/main/java/net/kemitix/node/NodeItem.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }