Fix crash in combo box update (#1306)
This commit is contained in:
committed by
GitHub
parent
cdc6032380
commit
89c2f82c19
@@ -2908,9 +2908,9 @@ namespace wi::gui
|
||||
|
||||
font.params.posY = translation.y + sprites[state].params.siz.y * 0.5f;
|
||||
|
||||
selected = std::min((int)items.size(), selected);
|
||||
selected = std::min(selected, (int)items.size() - 1);
|
||||
|
||||
if (selected >= 0)
|
||||
if (selected >= 0 && selected < (int)items.size())
|
||||
{
|
||||
selected_font.SetText(items[selected].name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user