]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task #3231: Sketcher Offset of a curve.
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Tue, 30 Jun 2020 11:05:23 +0000 (14:05 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Tue, 30 Jun 2020 11:05:23 +0000 (14:05 +0300)
Fix crash on Linear and Angular Copies.

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) {