Don't allow to use too big index in ItemList

This commit is contained in:
Rafał Mikrut 2020-01-14 20:17:48 +01:00
parent 56d8a2295d
commit 724f5f3178

View file

@ -993,7 +993,7 @@ void ItemList::_notification(int p_what) {
}
//ensure_selected_visible needs to be checked before we draw the list.
if (ensure_selected_visible && current >= 0 && current <= items.size()) {
if (ensure_selected_visible && current >= 0 && current < items.size()) {
Rect2 r = items[current].rect_cache;
int from = scroll_bar->get_value();