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:
Marianne Gagnon
2015-08-04 19:31:38 -04:00
parent bd85f51779
commit c2feb458af

View File

@@ -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);
}
}