From: dbv Date: Tue, 4 Apr 2017 12:38:04 +0000 (+0300) Subject: Fixed crash when attribute External in feature Projection changed. X-Git-Tag: V_2.7.0~81 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=474d54f4a29c21663e829a979f5841d5e1b85383;p=modules%2Fshaper.git Fixed crash when attribute External in feature Projection changed. --- diff --git a/src/Model/Model_SelectionNaming.cpp b/src/Model/Model_SelectionNaming.cpp index 42c97b2a9..966618b18 100644 --- a/src/Model/Model_SelectionNaming.cpp +++ b/src/Model/Model_SelectionNaming.cpp @@ -143,8 +143,11 @@ std::string Model_SelectionNaming::namingName(ResultPtr& theContext, const bool theAnotherDoc) { std::string aName("Undefined name"); - if(!theContext.get() || theContext->shape()->isNull()) + if(!theContext.get() + || !theContext->shape().get() + || theContext->shape()->isNull()) { return !theDefaultName.empty() ? theDefaultName : aName; + } // if it is in result of another part std::shared_ptr aDoc = diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index 8b3f61127..2a034e0f5 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -126,7 +126,7 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) ResultConstructionPtr aResult = std::dynamic_pointer_cast(lastResult()); - if (aResult && aResult->shape()) { + if (aResult && aResult->shape() && theID == EXTERNAL_FEATURE_ID()) { aResult->setShape(std::shared_ptr()); aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape()); }