summaryrefslogtreecommitdiff
path: root/xmerge/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-10-28 20:54:42 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-10-28 20:54:42 +0000
commit4a0a89f2ee602394f3b67437eb047ace33f2ada6 (patch)
tree2bc065255fe5397c513aed5334ef543d2b91efd9 /xmerge/source
parent0d8f7f69c632c34621cac46db5358ebc908434f6 (diff)
coverity#1326465 Dereference null return value
Change-Id: I0bb704e3f49444c7b377ac22acb52cf2dd58325f
Diffstat (limited to 'xmerge/source')
-rw-r--r--xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java
index 71e68f342a66..9cf24bf42fdf 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java
@@ -45,8 +45,10 @@ public final class XmlUtil {
// clone the starting node
Node clonedNode = cloneNode(docNode, newNode);
- // then clone the sub-tree recursively
- cloneTree(docNode, clonedNode, newNode);
+ if (clonedNode != null) {
+ // then clone the sub-tree recursively
+ cloneTree(docNode, clonedNode, newNode);
+ }
return clonedNode;
}
@@ -166,4 +168,4 @@ public final class XmlUtil {
return buffer.toString();
}
-} \ No newline at end of file
+}