fix crash when removing from document and accessing Python based feature

This commit is contained in:
wmayer
2019-01-13 17:50:48 +01:00
parent 1787144dee
commit 667c4c18b2

View File

@@ -172,8 +172,12 @@ public:
/** @name Property serialization */
//@{
void Save (Base::Writer &writer) const {
writer.ObjectName = this->getNameInDocument();
props->Save(writer);
const char* objname = this->getNameInDocument();
// if null then it's not part of the document
if (objname) {
writer.ObjectName = objname;
props->Save(writer);
}
}
void Restore(Base::XMLReader &reader) {
props->Restore(reader);