From: azv Date: Mon, 31 Oct 2016 09:23:00 +0000 (+0300) Subject: Protect "Multi" constraint if it already removed (issue #1790) X-Git-Tag: V_2.6.0~139 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7c6fb179cda3b2f3a8489e416d54af7f93b361e6;p=modules%2Fshaper.git Protect "Multi" constraint if it already removed (issue #1790) Do not update such constraint if it is in queue for remove. --- diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp index df18477ed..0ee95310f 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp @@ -73,6 +73,8 @@ void SketchSolver_ConstraintMulti::update(bool isForce) AttributeRefListPtr anInitialRefList = std::dynamic_pointer_cast( 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