]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix of non-correct statement
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 6 Sep 2016 12:42:30 +0000 (15:42 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 6 Sep 2016 12:42:44 +0000 (15:42 +0300)
src/SketchPlugin/SketchPlugin_Validators.cpp

index 5cb16e6b0b6bd737b5dc2a4b2bd82917e2f02d82..9db33a5ed0bd0080c9d7e87d1561e717cfe67355 100755 (executable)
@@ -891,13 +891,16 @@ bool SketchPlugin_ProjectionValidator::isValid(const AttributePtr& theAttribute,
   AttributeSelectionPtr aFeatureAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
   std::shared_ptr<GeomAPI_Edge> anEdge;
-  if(aFeatureAttr && aFeatureAttr->value() && aFeatureAttr->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aFeatureAttr->value()));
-  } else if(aFeatureAttr->context() && aFeatureAttr->context()->shape() &&
-            aFeatureAttr->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aFeatureAttr->context()->shape()));
+  if (aFeatureAttr.get()) {
+    GeomShapePtr aVal = aFeatureAttr->value();
+    ResultPtr aRes = aFeatureAttr->context();
+    if(aFeatureAttr->value() && aFeatureAttr->value()->isEdge()) {
+      anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aFeatureAttr->value()));
+    } else if(aFeatureAttr->context() && aFeatureAttr->context()->shape() &&
+              aFeatureAttr->context()->shape()->isEdge()) {
+      anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aFeatureAttr->context()->shape()));
+    }
   }
-
   if (!anEdge) {
     theError = "The attribute %1 should be an edge";
     theError.arg(theAttribute->id());