Salome HOME
Task #3231: Sketcher Offset of a curve.
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.cpp
index 42220392d37f5e1007ab042d4e389e7ca8180f36..beaef63a756a840074cafa3c52796798444b1d03 100644 (file)
@@ -552,10 +552,12 @@ bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute,
       if (!isFound) {
         // check in the results of the feature
         FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*anObjIter);
-        const std::list<ResultPtr>& aResults = aFeature->results();
-        for (std::list<ResultPtr>::const_iterator aResIt = aResults.begin();
-             aResIt != aResults.end() && !isFound; ++aResIt) {
-          isFound = aSelObject == *aResIt;
+        if (aFeature) {
+          const std::list<ResultPtr>& aResults = aFeature->results();
+          for (std::list<ResultPtr>::const_iterator aResIt = aResults.begin();
+            aResIt != aResults.end() && !isFound; ++aResIt) {
+            isFound = aSelObject == *aResIt;
+          }
         }
       }
       if (isFound) {