From: mpv Date: Sat, 29 Dec 2018 08:49:16 +0000 (+0300) Subject: Fix for python dump checker. X-Git-Tag: End2018~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3bbf89a595287dbdeac133910981a23cbc72f100;p=modules%2Fshaper.git Fix for python dump checker. If selection references to removed object, it has null context, but after dump/load it is not-initialized. --- diff --git a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp index f0d4deb48..b1feda567 100644 --- a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp +++ b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp @@ -225,7 +225,10 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { } else if (aType == ModelAPI_AttributeSelection::typeId()) { AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttr); - aResult<namingName(); + if (anAttr->context().get()) + aResult<namingName(); + else + aResult<<"__notinitialized__"; } else if (aType == ModelAPI_AttributeSelectionList::typeId()) { AttributeSelectionListPtr anAttr = std::dynamic_pointer_cast(theAttr);