when saving parameters make sure document exists

This commit is contained in:
wmayer
2019-03-12 01:05:50 +01:00
parent 43055f4613
commit 6f59c842c8

View File

@@ -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;
}