Skip to content

Commit

Permalink
Prevent crash from -1 array idx when searching zones (#75834)
Browse files Browse the repository at this point in the history
Prevents a crash when searching for zones to add, but the search yields
no results.
  • Loading branch information
inogenous authored Aug 20, 2024
1 parent af5deae commit de745ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit de745ea

Please sign in to comment.