From 851972250f5576958668151164eb3b8a18cf9750 Mon Sep 17 00:00:00 2001 From: sbh Date: Wed, 24 Sep 2014 16:27:27 +0400 Subject: [PATCH] Issue #118 Crash on "Remove Part" resolved --- src/XGUI/XGUI_ActionsMgr.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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()); -- 2.39.2