From: dbv Date: Wed, 18 Jan 2017 15:32:53 +0000 (+0300) Subject: Issue #1976: Application crashes when loading python script X-Git-Tag: V_2.7.0~321 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4c804a6988b0480e70225d17bb819a3b7b544968;p=modules%2Fshaper.git Issue #1976: Application crashes when loading python script Fixed crash. --- 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)