summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-04-10 13:45:34 +0200
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2016-04-25 22:24:12 +0200
commit2ab5a0bc2589e36b4e8b8dfcc93116c7bffaf51a (patch)
tree26f6b7c93cd8214f3dd48d96124187af938167c9
parent445103115a99e427be727ead070c2700ed4175d6 (diff)
fixed nullpointer exceptions in XML output.
-rw-r--r--src/plugins/xml/XmlOutput.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/xml/XmlOutput.cpp b/src/plugins/xml/XmlOutput.cpp
index 80b3af5..0d7b0dc 100644
--- a/src/plugins/xml/XmlOutput.cpp
+++ b/src/plugins/xml/XmlOutput.cpp
@@ -179,7 +179,9 @@ void XmlTransformer::writeXml(Handle<Document> doc, std::ostream &out,
}
}
Rooted<Element> ontology = transformOntology(document, o, P);
- document->addChild(ontology);
+ if (ontology != nullptr) {
+ document->addChild(ontology);
+ }
}
// write imports for all referenced typesystems.
for (auto t : doc->getTypesystems()) {
@@ -198,7 +200,9 @@ void XmlTransformer::writeXml(Handle<Document> doc, std::ostream &out,
}
}
Rooted<Element> typesystem = transformTypesystem(document, t, P);
- document->addChild(typesystem);
+ if (typesystem != nullptr) {
+ document->addChild(typesystem);
+ }
}
// transform the root element (and, using recursion, everything below it)