Ver Fonte

Don't try to move selection if there are no visible elements

Felix Yuan há 10 meses atrás
pai
commit
f491d2fe24
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      editor/gui/editor_quick_open_dialog.cpp

+ 4 - 0
editor/gui/editor_quick_open_dialog.cpp

@@ -489,6 +489,10 @@ void QuickOpenResultContainer::handle_search_box_input(const Ref<InputEvent> &p_
 }
 
 void QuickOpenResultContainer::_move_selection_index(Key p_key) {
+	// Don't move selection if there are no results.
+	if (num_visible_results <= 0) {
+		return;
+	}
 	const int max_index = num_visible_results - 1;
 
 	int idx = selection_index;