From d24741939099378df05801e5f620d31507fe66cf Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 9 Jul 2015 16:09:45 +0300 Subject: [PATCH] Issue #744 - Application crash after editing a parameter used in an expression Results with empty shape is not valid for the widget selector. --- src/ModuleBase/ModuleBase_WidgetValidated.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.cpp b/src/ModuleBase/ModuleBase_WidgetValidated.cpp index a90eadac2..aa774ca55 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidated.cpp @@ -70,7 +70,8 @@ bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrs& th // creates a selection owner on the base of object shape and the object AIS object if (anOwner.IsNull() && thePrs.owner().IsNull() && thePrs.object().get()) { ResultPtr aResult = myWorkshop->selection()->getResult(thePrs); - if (aResult.get()) { + if (aResult.get() && aResult->shape().get()) { + // some results have no shape, e.g. the parameter one. So, they should not be validated GeomShapePtr aShape = aResult->shape(); const TopoDS_Shape aTDShape = aShape->impl(); Handle(AIS_InteractiveObject) anIO = myWorkshop->selection()->getIO(thePrs); @@ -78,7 +79,7 @@ bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrs& th myPresentedObject = aResult; } else - aValid = false; // only results can be filtered + aValid = false; // only results with a shape can be filtered } // checks the owner by the AIS context activated filters if (!anOwner.IsNull()) { -- 2.39.2