From de745eabd78a9fde492ec26400140c48f3fd20d2 Mon Sep 17 00:00:00 2001 From: inogenous <123803852+inogenous@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:49:56 +0200 Subject: [PATCH] Prevent crash from -1 array idx when searching zones (#75834) Prevents a crash when searching for zones to add, but the search yields no results. --- src/ui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui.cpp b/src/ui.cpp index fb1c076070b41..d8a540aa10cb5 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -137,7 +137,7 @@ void uilist_impl::draw_controls() std::string description; if( !parent.footer_text.empty() ) { description = parent.footer_text; - } else if( parent.selected >= -1 ) { + } else if( parent.selected >= 0 ) { description = parent.entries[parent.selected].desc; } cataimgui::draw_colored_text( description );