From: sbh Date: Wed, 24 Sep 2014 12:27:27 +0000 (+0400) Subject: Issue #118 Crash on "Remove Part" resolved X-Git-Tag: V_0.4.4~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=851972250f5576958668151164eb3b8a18cf9750;p=modules%2Fshaper.git Issue #118 Crash on "Remove Part" resolved --- diff --git a/src/XGUI/XGUI_ActionsMgr.cpp b/src/XGUI/XGUI_ActionsMgr.cpp index 843981afa..c3a35fe7c 100644 --- a/src/XGUI/XGUI_ActionsMgr.cpp +++ b/src/XGUI/XGUI_ActionsMgr.cpp @@ -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());