X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_ConstraintMiddle.cpp;h=69de3881e0c751381c97375320a71c41c38ac9f2;hb=4f565b2204d3fba046aa8c851abada2a5a17bf6c;hp=545fa468716157c323ccdbf7cbc92b6762b6666b;hpb=4ed131ce78969b71c4ba5b44bda8cc3d5aee99a6;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp b/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp index 545fa4687..69de3881e 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + #include #include @@ -32,6 +34,12 @@ void SketchSolver_ConstraintMiddle::notifyCoincidenceChanged( for (int i = 0; i < 2 && isSameAttr; ++i) { AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast( myBaseConstraint->attribute(SketchPlugin_Constraint::ATTRIBUTE(i))); + if (!aRefAttr) + { + // It seems the Middle point constraint has been deleted, so keep it unchanged. + // It will be removed later. + return; + } if (aRefAttr->isObject()) { FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttr->object()); isSameAttr = (aFeature == aLine);