From: azv Date: Fri, 20 Mar 2015 07:52:57 +0000 (+0300) Subject: Verification the sketch data is not empty X-Git-Tag: V_1.1.0~101 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=55c9a4558cec9e3e781a0e0bc66f9d0bf418a611;p=modules%2Fshaper.git Verification the sketch data is not empty --- diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.cpp b/src/SketchSolver/SketchSolver_ConstraintManager.cpp index aeaad1aed..72cb9f214 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintManager.cpp @@ -354,13 +354,16 @@ std::shared_ptr SketchSolver_ConstraintManager if (aVerified.find(aWP) != aVerified.end()) continue; - std::shared_ptr aWPFeatures = std::dynamic_pointer_cast< - ModelAPI_AttributeRefList>(aWP->data()->attribute(SketchPlugin_Sketch::FEATURES_ID())); - std::list aFeaturesList = aWPFeatures->list(); - std::list::const_iterator anIter; - for (anIter = aFeaturesList.begin(); anIter != aFeaturesList.end(); anIter++) - if (*anIter == theFeature) - return aWP; // workplane is found + DataPtr aData = aWP->data(); + if (aData) { + std::shared_ptr aWPFeatures = std::dynamic_pointer_cast< + ModelAPI_AttributeRefList>(aData->attribute(SketchPlugin_Sketch::FEATURES_ID())); + std::list aFeaturesList = aWPFeatures->list(); + std::list::const_iterator anIter; + for (anIter = aFeaturesList.begin(); anIter != aFeaturesList.end(); anIter++) + if (*anIter == theFeature) + return aWP; // workplane is found + } aVerified.insert(aWP); }