From: azv Date: Tue, 7 Apr 2015 11:08:55 +0000 (+0300) Subject: Avoid working with empty attributes in constraints of sketch solver X-Git-Tag: V_1.1.0~54^2~8^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ecdaaaad4b49203ba113f2d5f1085879af6ad56d;p=modules%2Fshaper.git Avoid working with empty attributes in constraints of sketch solver --- diff --git a/src/SketchSolver/SketchSolver_Constraint.cpp b/src/SketchSolver/SketchSolver_Constraint.cpp index 370bdce0d..b86ce1a28 100644 --- a/src/SketchSolver/SketchSolver_Constraint.cpp +++ b/src/SketchSolver/SketchSolver_Constraint.cpp @@ -282,7 +282,7 @@ Slvs_hEntity SketchSolver_Constraint::changeEntity(AttributeRefAttrPtr theAttrib Slvs_hEntity SketchSolver_Constraint::changeEntity(AttributePtr theEntity, int& theType) { Slvs_hEntity aResult = SLVS_E_UNKNOWN; - if (!isInitialized(theEntity)) + if (!theEntity || !isInitialized(theEntity)) return SLVS_E_UNKNOWN; // If the entity is already in the group, try to find it @@ -378,7 +378,7 @@ Slvs_hEntity SketchSolver_Constraint::changeEntity(AttributePtr theEntity, int& Slvs_hEntity SketchSolver_Constraint::changeEntity(FeaturePtr theEntity, int& theType) { Slvs_hEntity aResult = SLVS_E_UNKNOWN; - if (!theEntity->data() || !theEntity->data()->isValid()) + if (!theEntity || !theEntity->data() || !theEntity->data()->isValid()) return SLVS_E_UNKNOWN; // If the entity is already in the group, try to find it std::map::const_iterator anEntIter = myFeatureMap.find(theEntity);