]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/XGUI/XGUI_ErrorMgr.cpp
Salome HOME
Providing Action class to have a common approach to start/finish/abort model transact...
[modules/shaper.git] / src / XGUI / XGUI_ErrorMgr.cpp
index 9dda1abbb0ed1f23d7eaa6c83ce2a42eac9b1ebc..500452a44d0ebdb8921d756ec7210cb497bffd95 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <ModuleBase_IPropertyPanel.h>
 #include <ModuleBase_ModelWidget.h>
+#include <ModuleBase_OperationFeature.h>
 
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_Session.h>
@@ -45,14 +46,15 @@ const char* toString(ModelAPI_ExecState theExecState)
 void XGUI_ErrorMgr::onValidationStateChanged()
 {
   XGUI_OperationMgr* anOperationMgr = dynamic_cast<XGUI_OperationMgr*>(sender());
-  if (!anOperationMgr || !anOperationMgr->currentOperation())
+  if (!anOperationMgr)
     return;
-
-  if (!myPropertyPanel)
+  ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+                                                  (anOperationMgr->currentOperation());
+  if (!myPropertyPanel || !aFOperation)
     return;
 
   // get feature
-  FeaturePtr aFeature = anOperationMgr->currentOperation()->feature();
+  FeaturePtr aFeature = aFOperation->feature();
   if (!aFeature.get() || !aFeature->data()->isValid())
     return;