Browse Source

Don't allow to use too big index in ItemList

Rafał Mikrut 5 years ago
parent
commit
724f5f3178
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/gui/item_list.cpp

+ 1 - 1
scene/gui/item_list.cpp

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