Skip to content

Commit

Permalink
Merge pull request #8 from mkrueger/mkrueger/fix-overflow
Browse files Browse the repository at this point in the history
Fixed overflow exception.
  • Loading branch information
mkrueger authored Aug 2, 2023
2 parents 577bbdc + 1cb6dd1 commit ec4a1fc
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 ec4a1fc

Please sign in to comment.