Salome HOME
Fixed crash when attribute External in feature Projection changed.
authordbv <dbv@opencascade.com>
Tue, 4 Apr 2017 12:38:04 +0000 (15:38 +0300)
committerdbv <dbv@opencascade.com>
Tue, 4 Apr 2017 12:38:26 +0000 (15:38 +0300)
src/Model/Model_SelectionNaming.cpp
src/SketchPlugin/SketchPlugin_Projection.cpp

index 42c97b2a973d366a2bd6812df240f23e840d1589..966618b183cfa0cdf552d703804df6b78b2a7813 100644 (file)
@@ -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<Model_Document> aDoc =
index 8b3f611273f24549d96af5d1882e03d3e0a7f6a5..2a034e0f5f72c8bd6db7f6e6ab68263df23e8c41 100644 (file)
@@ -126,7 +126,7 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID)
 
   ResultConstructionPtr aResult =
       std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(lastResult());
-  if (aResult && aResult->shape()) {
+  if (aResult && aResult->shape() && theID == EXTERNAL_FEATURE_ID()) {
     aResult->setShape(std::shared_ptr<GeomAPI_Edge>());
     aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape());
   }