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

Unwrap in menu overlay causes app to crash #301

Closed
andrewdavidmackenzie opened this issue Nov 14, 2024 · 3 comments · Fixed by #307
Closed

Unwrap in menu overlay causes app to crash #301

andrewdavidmackenzie opened this issue Nov 14, 2024 · 3 comments · Fixed by #307

Comments

@andrewdavidmackenzie
Copy link
Contributor

In my app, some hardware events cause additions to / removals from menus asynchronously.

It seems that when that happens and the menu is open, a crash happens.

It seems to be this Option unwrap:

https://github.com/iced-rs/iced_aw/blob/main/src/widget/menu/menu_bar_overlay.rs#L90

@genusistimelord
Copy link
Collaborator

We may need to remove the unwrap and replace it with a full if let statement for menu. that should fix the error.

@andrewdavidmackenzie
Copy link
Contributor Author

I now have another (more frequent, less avoidable) case where this crashes my app.

Would you be open to a PR avoiding it?

@andrewdavidmackenzie
Copy link
Contributor Author

"Thar she blows...." #307

I fixed the 2 or 3 that were causing my particular crash, plus others I could see in the file.

To fix completely might require some restructuring of those methods.

Idea goal would be to remove the allow of unwraps at the top of the file.

If you review the PR with comments, I am willing to address those comments and get the PR into a state for merging.

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 a pull request may close this issue.

2 participants