From 4c804a6988b0480e70225d17bb819a3b7b544968 Mon Sep 17 00:00:00 2001 From: dbv Date: Wed, 18 Jan 2017 18:32:53 +0300 Subject: [PATCH] Issue #1976: Application crashes when loading python script Fixed crash. --- src/ModelHighAPI/ModelHighAPI_Selection.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.cpp b/src/ModelHighAPI/ModelHighAPI_Selection.cpp index 6b2862ae6..e446cff41 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Selection.cpp @@ -104,8 +104,13 @@ std::string ModelHighAPI_Selection::shapeType() const //================================================================================================== void ModelHighAPI_Selection::setName(const std::string& theName) { - if (myVariantType == VT_ResultSubShapePair) - myResultSubShapePair.first->data()->setName(theName); + if (myVariantType == VT_ResultSubShapePair) { + std::shared_ptr aResult = myResultSubShapePair.first; + if(!aResult.get()) { + return; + } + aResult->data()->setName(theName); + } } void ModelHighAPI_Selection::setColor(int theRed, int theGreen, int theBlue) -- 2.39.2