]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Verification the sketch data is not empty
authorazv <azv@opencascade.com>
Fri, 20 Mar 2015 07:52:57 +0000 (10:52 +0300)
committerazv <azv@opencascade.com>
Fri, 20 Mar 2015 07:52:57 +0000 (10:52 +0300)
src/SketchSolver/SketchSolver_ConstraintManager.cpp

index aeaad1aed342010b0dd5461c5243906111081a0c..72cb9f214437e8f224999e6390f26d32cc458f6d 100644 (file)
@@ -354,13 +354,16 @@ std::shared_ptr<ModelAPI_CompositeFeature> SketchSolver_ConstraintManager
     if (aVerified.find(aWP) != aVerified.end())
       continue;
 
-    std::shared_ptr<ModelAPI_AttributeRefList> aWPFeatures = std::dynamic_pointer_cast<
-        ModelAPI_AttributeRefList>(aWP->data()->attribute(SketchPlugin_Sketch::FEATURES_ID()));
-    std::list<ObjectPtr> aFeaturesList = aWPFeatures->list();
-    std::list<ObjectPtr>::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<ModelAPI_AttributeRefList> aWPFeatures = std::dynamic_pointer_cast<
+          ModelAPI_AttributeRefList>(aData->attribute(SketchPlugin_Sketch::FEATURES_ID()));
+      std::list<ObjectPtr> aFeaturesList = aWPFeatures->list();
+      std::list<ObjectPtr>::const_iterator anIter;
+      for (anIter = aFeaturesList.begin(); anIter != aFeaturesList.end(); anIter++)
+        if (*anIter == theFeature)
+          return aWP;  // workplane is found
+    }
     aVerified.insert(aWP);
   }