Skip to content

Commit

Permalink
Fixed overflow exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed Aug 2, 2023
1 parent 577bbdc commit 1cb6dd1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,12 @@ impl eframe::App for GameCheetahEngine {
self.current_search = i;
}
}
if ui.button("-").clicked() {
if self.current_search < self.searches.len() && ui.button("-").clicked() {
self.remove_freezes(self.current_search);
self.searches.remove(self.current_search);
if self.current_search >= self.searches.len() - 1 {
self.current_search = max(0, self.current_search - 1);
if self.current_search > 0 {
self.current_search -= 1;
}
return;
}
if ui.button("+").clicked() {
self.new_search();
Expand Down

0 comments on commit 1cb6dd1

Please sign in to comment.