Don't crash if selection is larger than number of items in ribbon widget
This commit is contained in:
parent
25ca5646ff
commit
4049722677
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user