diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index ce32fc9b55..fc505795df 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -452,10 +452,10 @@ void EDA_DRAW_FRAME::PushTool( const std::string& actionName ) void EDA_DRAW_FRAME::PopTool() { - m_toolStack.pop_back(); - - if( !m_toolStack.empty() ) + if( m_toolStack.size() > 1 ) { + m_toolStack.pop_back(); + TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( m_toolStack.back() ); if( action ) diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp index cb30517bc6..1b681032d8 100644 --- a/common/tool/action_manager.cpp +++ b/common/tool/action_manager.cpp @@ -207,12 +207,12 @@ int ACTION_MANAGER::processHotKey( TOOL_ACTION* aAction, std::map aHotKeyMap ) { aAction->m_hotKey = aAction->m_defaultHotKey; - + if( !aAction->m_legacyName.empty() && aLegacyMap.count( aAction->m_legacyName ) ) aAction->SetHotKey( aLegacyMap[ aAction->m_legacyName ] ); - + if( aHotKeyMap.count( aAction->m_name ) ) aAction->SetHotKey( aHotKeyMap[ aAction->m_name ] ); - + return aAction->m_hotKey; }