summaryrefslogtreecommitdiff
path: root/xmerge
diff options
context:
space:
mode:
Diffstat (limited to 'xmerge')
-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
+}