summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2019-01-09 17:42:44 (GMT)
committerDavid A. Madore <david+git@madore.org>2019-01-09 17:43:38 (GMT)
commitda483e0f6b1ee11c55ba66882c1baeeb2bab881e (patch)
tree606967c0eaf762db5d6b83caa215c43581ae1320
parent143c527add56bdc98968383155c9d928d1460e42 (diff)
downloaddamlengine-da483e0f6b1ee11c55ba66882c1baeeb2bab881e.zip
damlengine-da483e0f6b1ee11c55ba66882c1baeeb2bab881e.tar.gz
damlengine-da483e0f6b1ee11c55ba66882c1baeeb2bab881e.tar.bz2
Fix a null pointer exception.
-rw-r--r--org/madore/damlengine/TodoImgAElement.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org/madore/damlengine/TodoImgAElement.java b/org/madore/damlengine/TodoImgAElement.java
index aa545bc..0d8edf6 100644
--- a/org/madore/damlengine/TodoImgAElement.java
+++ b/org/madore/damlengine/TodoImgAElement.java
@@ -26,7 +26,11 @@ public final class TodoImgAElement extends TodoDefaultElement {
Element a = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "a");
if ( explicitLang != null )
LangHelper.setLangNorec(node, explicitLang);
- node.getParentNode().replaceChild(a, node);
+ Node pnode = node.getParentNode();
+ if ( pnode == null )
+ // See "FIXME" in TodoCutHere.java (node may have moved out of DOM).
+ return;
+ pnode.replaceChild(a, node);
Element img = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "img");
a.appendChild(img);
ArrayList<Attr> attrList = getAttrList(this.node);