Salome HOME
Implementation of names of features selection.
[modules/shaper.git] / src / GeomValidators / GeomValidators_IntersectionSelection.cpp
index 0100988007bf5812e038acc1140d7e1b61cb29ce..fe437a01a8884929d87658487fbb0595ca876044 100644 (file)
@@ -45,12 +45,18 @@ bool GeomValidators_IntersectionSelection::isValid(const AttributePtr& theAttrib
       theError = "Error: empty attribute selection.";
       return false;
     }
+    FeaturePtr aFeature;
     ResultPtr aContext = anAttrSelection->context();
     if(!aContext.get()) {
-      theError = "Error: empty selection context.";
-      return false;
+      aFeature = anAttrSelection->contextFeature();
+      if (!aFeature.get()) {
+        theError = "Error: Empty selection context.";
+        return false;
+      }
+    } else {
+      aFeature = ModelAPI_Feature::feature(aContext);
     }
-    FeaturePtr aFeature = ModelAPI_Feature::feature(aContext);
+
     if(!aFeature.get()) {
       theError = "Error: empty feature.";
       return false;