From ec86db4bfbb1f7e165d0620cb4d85c2b9beb36bc Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 12 Mar 2019 01:05:50 +0100 Subject: [PATCH] when saving parameters make sure document exists --- src/Base/Parameter.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Base/Parameter.cpp b/src/Base/Parameter.cpp index d6a392b550..57d1387c7a 100644 --- a/src/Base/Parameter.cpp +++ b/src/Base/Parameter.cpp @@ -1353,10 +1353,12 @@ void ParameterManager::SaveDocument(XMLFormatTarget* pFormatTarget) const // // do the serialization through DOMWriter::writeNode(); // - DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); - theOutput->setEncoding(gOutputEncoding); - theOutput->setByteStream(pFormatTarget); - theSerializer->write(_pDocument, theOutput); + if (_pDocument) { + DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); + theOutput->setEncoding(gOutputEncoding); + theOutput->setByteStream(pFormatTarget); + theSerializer->write(_pDocument, theOutput); + } delete theSerializer; }