Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correcting menu (index error when less than 2 items) #279

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

Ultraxime
Copy link
Contributor

When a menu had at most one item, it was falling with an index out of bound exception.

An empty menu would return :

thread 'main' panicked at /home/user/.cargo/git/checkouts/iced_aw-d8617147b960a6c7/18cf814/src/widgets/menu/menu_tree.rs:245:25:
index out of bounds: the len is 0 but the index is 0

And a menu with one item :

thread 'main' panicked at /home/user/.cargo/git/checkouts/iced_aw-d8617147b960a6c7/18cf814/src/widgets/menu/menu_tree.rs:454:19:
range end index 2 out of range for slice of length 1

It seems to come from missing parenthesis during the comparison.

This PR is supposed to solve that

Copy link
Collaborator

@genusistimelord genusistimelord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you.

@genusistimelord genusistimelord merged commit f631711 into iced-rs:main Aug 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants