Don't crash if selection is larger than number of items in ribbon widget

This commit is contained in:
Deve 2015-10-21 22:37:38 +02:00
parent 25ca5646ff
commit 4049722677

View File

@ -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)
{