Salome HOME
Initial iteration for storage the back references and making concealment only on...
[modules/shaper.git] / src / XGUI / XGUI_ActionsMgr.cpp
index 843981afa30842414e15cbb198b5cf6c1ff27f94..c3a35fe7cbc534739d8db3a16a52ed3ed00ccef4 100644 (file)
@@ -61,12 +61,14 @@ void XGUI_ActionsMgr::addNestedCommands(const QString& theId, const QStringList&
 void XGUI_ActionsMgr::update()
 {
   if (myOperationMgr->hasOperation()) {
-    setAllEnabled(false);
     ModuleBase_Operation* anOperation = myOperationMgr->currentOperation();
     FeaturePtr aFeature = anOperation->feature();
-    QString aFeatureId = QString::fromStdString(aFeature->getKind());
-    setActionEnabled(aFeatureId, true);
-    setNestedStackEnabled(anOperation);
+    if(aFeature) {
+      setAllEnabled(false);
+      QString aFeatureId = QString::fromStdString(aFeature->getKind());
+      setActionEnabled(aFeatureId, true);
+      setNestedStackEnabled(anOperation);
+    }
   } else {
     setAllEnabled(true);
     setNestedCommandsEnabled(false);
@@ -85,7 +87,7 @@ void XGUI_ActionsMgr::setAllEnabled(bool isEnabled)
 
 void XGUI_ActionsMgr::setNestedStackEnabled(ModuleBase_Operation* theOperation)
 {
-  if(theOperation == NULL)
+  if(!theOperation || !theOperation->feature())
     return;
   FeaturePtr aFeature = theOperation->feature();
   QString aFeatureId = QString::fromStdString(aFeature->getKind());