From 3bbf89a595287dbdeac133910981a23cbc72f100 Mon Sep 17 00:00:00 2001 From: mpv Date: Sat, 29 Dec 2018 11:49:16 +0300 Subject: [PATCH] Fix for python dump checker. If selection references to removed object, it has null context, but after dump/load it is not-initialized. --- src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.39.2