summaryrefslogtreecommitdiff
path: root/xmerge
diff options
context:
space:
mode:
Diffstat (limited to 'xmerge')
-rw-r--r--xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java
index a7b54636cc86..72b65453029b 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java
@@ -88,17 +88,19 @@ public final class DocumentDeserializerImpl
while (enumerate.hasNext()) {
docOut = (DOMDocument) enumerate.next();
}
- try {
- domDoc = docOut.getContentDOM();
- baos = transform(domDoc);
- sxwDoc.initContentDOM();
- DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
- dFactory.setNamespaceAware(true);
- DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
- sxwDoc.setContentDOM(dBuilder.parse(new ByteArrayInputStream(baos.toByteArray())));
-
- } catch (Exception e) {
- System.out.println("The following error occurred:" + e);
+ if (docOut != null) {
+ try {
+ domDoc = docOut.getContentDOM();
+ baos = transform(domDoc);
+ sxwDoc.initContentDOM();
+ DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
+ dFactory.setNamespaceAware(true);
+ DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
+ sxwDoc.setContentDOM(dBuilder.parse(new ByteArrayInputStream(baos.toByteArray())));
+
+ } catch (Exception e) {
+ System.out.println("The following error occurred:" + e);
+ }
}
return sxwDoc;
}