From 977a74a47f5cb9215720a89759890795a10025e6 Mon Sep 17 00:00:00 2001 From: azv Date: Fri, 8 Jul 2016 09:24:06 +0300 Subject: [PATCH] Fix crash in the "Multi" constraints --- src/SketchSolver/SketchSolver_ConstraintMulti.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); -- 2.39.2