Skip to content

Fix panic when overlay event processing removes overlay#1700

Merged
hecrj merged 1 commit into
iced-rs:masterfrom
nicksenger:overlay/fix-panic
Feb 14, 2023
Merged

Fix panic when overlay event processing removes overlay#1700
hecrj merged 1 commit into
iced-rs:masterfrom
nicksenger:overlay/fix-panic

Conversation

@nicksenger

Copy link
Copy Markdown
Contributor

Currently if processing an event in the overlay both invalidates the layout and results in the overlay no longer being present (we hit line 251), the application will panic. This PR fixes the issue by using cursor_position for the base cursor position if the overlay no longer exists.

Example application that panics: https://gist.github.com/nicksenger/13f051ebdf34fbede31abe91981d70a6

@hecrj hecrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is what happens when you use unwrap, kids. Be careful out there.

Thanks again!

@hecrj hecrj added bug Something isn't working widget labels Feb 14, 2023
@hecrj hecrj added this to the 0.8.0 milestone Feb 14, 2023
@hecrj hecrj enabled auto-merge February 14, 2023 05:37
@hecrj hecrj merged commit efbf66b into iced-rs:master Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working widget

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants