From da483e0f6b1ee11c55ba66882c1baeeb2bab881e Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Wed, 9 Jan 2019 18:42:44 +0100 Subject: Fix a null pointer exception. --- org/madore/damlengine/TodoImgAElement.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 attrList = getAttrList(this.node); -- cgit v1.2.3