Salome HOME
Issue #2722: Check returned context
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetValidated.cpp
index 6fbd9b1749203f2bb5d23bf7a158f41070e96898..16b47680e337ab0a01b3dfd3951c90d9b3228d4a 100644 (file)
@@ -130,7 +130,8 @@ bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrsPtr&
             std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(anAttr);
           aSelectAttr->setValue(myPresentedObject, GeomShapePtr(), true);
           GeomShapePtr aShape = aSelectAttr->value();
-          if (!aShape.get() && aSelectAttr->contextFeature()->firstResult().get()) {
+          if (!aShape.get() && aSelectAttr->contextFeature().get() &&
+            aSelectAttr->contextFeature()->firstResult().get()) {
             aShape = aSelectAttr->contextFeature()->firstResult()->shape();
           }
           if (aShape.get()) {