From: azv Date: Fri, 8 Jul 2016 06:24:06 +0000 (+0300) Subject: Fix crash in the "Multi" constraints X-Git-Tag: V_2.5.0~217 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=977a74a47f5cb9215720a89759890795a10025e6;p=modules%2Fshaper.git Fix crash in the "Multi" constraints --- diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp index 3994f776f..952fecafd 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp @@ -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();