X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ActionsMgr.cpp;h=c3a35fe7cbc534739d8db3a16a52ed3ed00ccef4;hb=ed165fd07e71c11885fdc5f475a8522a5914e00d;hp=843981afa30842414e15cbb198b5cf6c1ff27f94;hpb=52558a1594f889f73337ed79f402a236e0f9b482;p=modules%2Fshaper.git 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());