]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix crash in the "Multi" constraints
authorazv <azv@opencascade.com>
Fri, 8 Jul 2016 06:24:06 +0000 (09:24 +0300)
committerazv <azv@opencascade.com>
Fri, 8 Jul 2016 06:24:06 +0000 (09:24 +0300)
src/SketchSolver/SketchSolver_ConstraintMulti.cpp

index 3994f776fba6829726dac40b550651f04ea588da..952fecafde345747888747c954693afe9a395e08 100644 (file)
@@ -197,8 +197,8 @@ void SketchSolver_ConstraintMulti::adjustConstraint()
 
 bool SketchSolver_ConstraintMulti::isUsed(FeaturePtr theFeature) const
 {
-  return myFeatures.find(theFeature) != myFeatures.end() ||
-         SketchSolver_Constraint::isUsed(theFeature);
+  return theFeature && (myFeatures.find(theFeature) != myFeatures.end() ||
+         SketchSolver_Constraint::isUsed(theFeature));
 }
 
 bool SketchSolver_ConstraintMulti::isUsed(AttributePtr theAttribute) const
@@ -212,6 +212,8 @@ bool SketchSolver_ConstraintMulti::isUsed(AttributePtr theAttribute) const
     else
       anAttribute = aRefAttr->attr();
   }
+  if (!anAttribute)
+    return false;
 
   FeaturePtr anOwner = ModelAPI_Feature::feature(anAttribute->owner());
   return myFeatures.find(anOwner) != myFeatures.end();