Skip to content

Commit

Permalink
Fix out of range error when traversing menus
Browse files Browse the repository at this point in the history
  • Loading branch information
shartrec committed Jul 21, 2024
1 parent 168c252 commit 42357b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widgets/menu/menu_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ where

Check failure on line 390 in src/widgets/menu/menu_tree.rs

View workflow job for this annotation

GitHub Actions / all

Diff in /home/runner/work/iced_aw/iced_aw/src/widgets/menu/menu_tree.rs
let menu_state = tree.state.downcast_ref::<MenuState>();
let slice = &menu_state.slice;
let max_item_slice = self.items.len().min(slice.end_index);
let max_tree_slice = tree.children.len().min(slice.end_index);
let max_item_slice = self.items.len()-1.min(slice.end_index);
let max_tree_slice = tree.children.len()-1.min(slice.end_index);

self.items[slice.start_index..=max_item_slice]
.iter()
Expand Down

0 comments on commit 42357b9

Please sign in to comment.