diff options
author | David A. Madore <david+git@madore.org> | 2019-01-09 18:42:44 +0100 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2019-01-09 18:43:38 +0100 |
commit | da483e0f6b1ee11c55ba66882c1baeeb2bab881e (patch) | |
tree | 606967c0eaf762db5d6b83caa215c43581ae1320 | |
parent | 143c527add56bdc98968383155c9d928d1460e42 (diff) | |
download | damlengine-da483e0f6b1ee11c55ba66882c1baeeb2bab881e.tar.gz damlengine-da483e0f6b1ee11c55ba66882c1baeeb2bab881e.tar.bz2 damlengine-da483e0f6b1ee11c55ba66882c1baeeb2bab881e.zip |
Fix a null pointer exception.
-rw-r--r-- | org/madore/damlengine/TodoImgAElement.java | 6 |
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); |