When restoring ribbon selection, consider that maybe the ribbon does not anymore contain as many items as previously. Fixes #2260
This commit is contained in:
@@ -560,7 +560,9 @@ EventPropagation RibbonWidget::focused(const int playerID)
|
||||
{
|
||||
if (m_selection[playerID] != -1)
|
||||
{
|
||||
m_active_children.get(m_selection[playerID])->focused(playerID);
|
||||
int selection = m_selection[playerID];
|
||||
if (selection < m_active_children.size())
|
||||
m_active_children.get(selection)->focused(playerID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user