Salome HOME
Parts results and activation/deactivation management (show/hide also)
[modules/shaper.git] / src / ModelAPI / ModelAPI_Feature.cpp
index 3ba486be3b2ba2c4fb1f15fc8f614b8a67e541bd..3c78c82d0a254403579b4068b47877724efb30d6 100644 (file)
@@ -146,7 +146,8 @@ void ModelAPI_Feature::erase()
   while (!myResults.empty()) {  // remove one by one with messages
     std::shared_ptr<ModelAPI_Result> aRes = *(myResults.begin());
     aRes->setDisabled(aRes, true); // to avoid activation of the Part result
-    myResults.erase(myResults.begin());
+    if (!myResults.empty()) // disabling result may erase the list (on undo of Part, issue 665)
+      myResults.erase(myResults.begin());
   }
   ModelAPI_Object::erase();
 }