Salome HOME
Protect "Multi" constraint if it already removed (issue #1790)
authorazv <azv@opencascade.com>
Mon, 31 Oct 2016 09:23:00 +0000 (12:23 +0300)
committerazv <azv@opencascade.com>
Mon, 31 Oct 2016 09:23:00 +0000 (12:23 +0300)
Do not update such constraint if it is in queue for remove.

src/SketchSolver/SketchSolver_ConstraintMulti.cpp

index df18477ed2a034f9d7f4e5814a9a154ffa52974d..0ee95310fd3844a9d9d3cb148acebcc09400e0a7 100644 (file)
@@ -73,6 +73,8 @@ void SketchSolver_ConstraintMulti::update(bool isForce)
   AttributeRefListPtr anInitialRefList = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
       myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_A()));
   AttributeIntegerPtr aNbObjects = myBaseConstraint->integer(nameNbObjects());
+  if (!anInitialRefList || !aNbObjects)
+    return; // the "Multi" constraint is in queue to remove
   bool isUpdated= anInitialRefList->size() != myNumberOfObjects || aNbObjects->value()-1 != myNumberOfCopies;
   if (!isUpdated) {
     // additional check that the features and their copies are changed