code.onehippo.org is currently readonly. We are migrating to code.bloomreach.com, please continue working there on Monday 14/12. See: https://docs.bloomreach.com/display/engineering/GitLab

Commit 715b5d6b authored by Ate Douma's avatar Ate Douma

REPO-1857 fix check if a node is the root node

parent 8d929053
......@@ -45,6 +45,8 @@ import org.hippoecm.repository.deriveddata.DerivedDataEngine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.onehippo.repository.util.JcrConstants.ROOT_NODE_ID;
public class NodeDecorator extends org.hippoecm.repository.decorating.NodeDecorator implements HippoNode {
private static final Logger log = LoggerFactory.getLogger(NodeDecorator.class);
......@@ -289,7 +291,7 @@ public class NodeDecorator extends org.hippoecm.repository.decorating.NodeDecora
}
}
if (!node.isNodeType(HippoNodeType.NT_NAMED)) {
if (node.equals(node.getSession().getRootNode())) {
if (ROOT_NODE_ID.equals(node.getIdentifier())) {
return getName();
}
final Node parent = node.getParent();
......
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