From f491d2fe2475bfd696a2094b60f5ae55efb3d2ad Mon Sep 17 00:00:00 2001 From: Felix Yuan Date: Thu, 31 Oct 2024 00:59:44 -0700 Subject: [PATCH] Don't try to move selection if there are no visible elements --- editor/gui/editor_quick_open_dialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/gui/editor_quick_open_dialog.cpp b/editor/gui/editor_quick_open_dialog.cpp index b8f3b259cab..0128f1f54cd 100644 --- a/editor/gui/editor_quick_open_dialog.cpp +++ b/editor/gui/editor_quick_open_dialog.cpp @@ -489,6 +489,10 @@ void QuickOpenResultContainer::handle_search_box_input(const Ref &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;