]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix crash when removing point under Middle and Coincidence constraints (issues #1762...
authorazv <azv@opencascade.com>
Mon, 31 Oct 2016 07:34:54 +0000 (10:34 +0300)
committerazv <azv@opencascade.com>
Mon, 31 Oct 2016 07:34:54 +0000 (10:34 +0300)
src/SketchSolver/SketchSolver_ConstraintMiddle.cpp

index 545fa468716157c323ccdbf7cbc92b6762b6666b..362bc58ccdc301c1cf5fe676b6337c9b2e6fa0d4 100644 (file)
@@ -32,6 +32,12 @@ void SketchSolver_ConstraintMiddle::notifyCoincidenceChanged(
   for (int i = 0; i < 2 && isSameAttr; ++i) {
     AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
         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);