diff --git a/src/guiengine/widgets/ribbon_widget.cpp b/src/guiengine/widgets/ribbon_widget.cpp index a9bae0023..efc52b545 100644 --- a/src/guiengine/widgets/ribbon_widget.cpp +++ b/src/guiengine/widgets/ribbon_widget.cpp @@ -690,7 +690,8 @@ EventPropagation RibbonWidget::transmitEvent(Widget* w, // bring focus back to enclosing ribbon widget this->setFocusForPlayer( playerID ); - if (m_selection[playerID] != -1) + if (m_selection[playerID] > -1 && + m_selection[playerID] < (int)(m_active_children.size())) { if (m_active_children[m_selection[playerID]].m_deactivated) {