From 474d54f4a29c21663e829a979f5841d5e1b85383 Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 4 Apr 2017 15:38:04 +0300 Subject: [PATCH] Fixed crash when attribute External in feature Projection changed. --- src/Model/Model_SelectionNaming.cpp | 5 ++++- src/SketchPlugin/SketchPlugin_Projection.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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()); } -- 2.39.2