diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 80e0c4eefd5..afef675bc18 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -182,6 +182,11 @@ void Tabs::_gui_input(const Ref &p_event) { } } + if (max_drawn_tab <= 0) { + // Return early if there are no actual tabs to handle input for. + return; + } + int found = -1; for (int i = offset; i <= max_drawn_tab; i++) { if (tabs[i].rb_rect.has_point(pos)) {