From 667c4c18b2b6bc42e772bf6622f175f521616e48 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 13 Jan 2019 17:50:48 +0100 Subject: [PATCH] fix crash when removing from document and accessing Python based feature --- src/App/FeaturePython.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/App/FeaturePython.h b/src/App/FeaturePython.h index d55fa3f8d5..ded1d5a233 100644 --- a/src/App/FeaturePython.h +++ b/src/App/FeaturePython.h @@ -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);