]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#1419 Fatal error when edit Vertex: fix
authornds <nds@opencascade.com>
Thu, 21 Apr 2016 04:55:09 +0000 (07:55 +0300)
committernds <nds@opencascade.com>
Thu, 21 Apr 2016 04:55:09 +0000 (07:55 +0300)
src/ModuleBase/ModuleBase_FilterValidated.cpp

index 3d57d9f186922d496466ac9532e5d620d5672748..c977072a831a9da84c606555301e3ac4544a0769 100644 (file)
@@ -27,15 +27,18 @@ Standard_Boolean ModuleBase_FilterValidated::IsOk(const Handle(SelectMgr_EntityO
     ModuleBase_ModelWidget* aCurrentWidget = aPanel->preselectionWidget();
     if (!aCurrentWidget)
       aCurrentWidget = myWorkshop->module()->activeWidget();
-    ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
-                                                                           (aCurrentWidget);
-    ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
-    myWorkshop->selection()->fillPresentation(aPrs, theOwner);
-    if (aWidgetValidated)
-      aValid = !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs);
-    else if (aCurrentWidget->widgetValidator()) {
-      ModuleBase_WidgetValidator* aWidgetValidator = aCurrentWidget->widgetValidator();
-      aValid = aWidgetValidator->isValidSelection(aPrs);
+    if (aCurrentWidget) {
+      ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
+      myWorkshop->selection()->fillPresentation(aPrs, theOwner);
+      ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
+                                                                             (aCurrentWidget);
+      if (aWidgetValidated)
+        aValid = !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs);
+      else{
+        ModuleBase_WidgetValidator* aWidgetValidator = aCurrentWidget->widgetValidator();
+        if (aWidgetValidator)
+          aValid = aWidgetValidator->isValidSelection(aPrs);
+      }
     }
   }