diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index caa23e0..e5db2fd 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -279,13 +279,15 @@ class NodeItem implements Node { @Override public void insertInPath(final Node nodeItem, final String... path) { if (path.length == 0) { - if (!nodeItem.isNamed()) { // nothing to conflict with + if (!nodeItem.isNamed()) { + // nothing to conflict with addChild(nodeItem); return; } String nodeName = nodeItem.getName(); final Optional> childNamed = findChildByName(nodeName); - if (!childNamed.isPresent()) { // nothing with the same name exists + if (!childNamed.isPresent()) { + // nothing with the same name exists addChild(nodeItem); return; }