From 7c6fb179cda3b2f3a8489e416d54af7f93b361e6 Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 31 Oct 2016 12:23:00 +0300 Subject: [PATCH] Protect "Multi" constraint if it already removed (issue #1790) Do not update such constraint if it is in queue for remove. --- src/SketchSolver/SketchSolver_ConstraintMulti.cpp | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.39.2