Skip to content

Commit 0d96cc7

Browse files
committed
[bugfix] Avoid NPE if MemTree Attribute does not have an owner Element
1 parent 4ce606a commit 0d96cc7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

exist-core/src/main/java/org/exist/dom/memtree/AttrImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ public void selectAncestors(boolean includeSelf, NodeTest test, Sequence result)
153153
if (test.matches(this)) {
154154
result.add(this);
155155
}
156-
((NodeImpl)getOwnerElement()).selectAncestors(true, test, result);
156+
final ElementImpl ownerElement = (ElementImpl) getOwnerElement();
157+
if (ownerElement != null) {
158+
ownerElement.selectAncestors(true, test, result);
159+
}
157160
}
158161

159162
@Override

0 commit comments

Comments
 (0)