From 4a0a89f2ee602394f3b67437eb047ace33f2ada6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 28 Oct 2015 20:54:42 +0000 Subject: coverity#1326465 Dereference null return value Change-Id: I0bb704e3f49444c7b377ac22acb52cf2dd58325f --- xmerge/source/xmerge/java/org/openoffice/xmerge/util/XmlUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xmerge/source') 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 +} -- cgit v1.2.3