]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #118 Crash on "Remove Part" resolved
authorsbh <sergey.belash@opencascade.com>
Wed, 24 Sep 2014 12:27:27 +0000 (16:27 +0400)
committersbh <sergey.belash@opencascade.com>
Wed, 24 Sep 2014 12:27:27 +0000 (16:27 +0400)
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());