Skip to content

Commit

Permalink
Merge pull request #1700 from nicksenger/overlay/fix-panic
Browse files Browse the repository at this point in the history
Fix panic when overlay event processing removes overlay
  • Loading branch information
hecrj authored Feb 14, 2023
2 parents 2c680a3 + 41822d0 commit efbf66b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions native/src/user_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,16 @@ where
}
}

let base_cursor = if manual_overlay
let base_cursor = manual_overlay
.as_ref()
.unwrap()
.is_over(Layout::new(&layout), cursor_position)
{
// TODO: Type-safe cursor availability
Point::new(-1.0, -1.0)
} else {
cursor_position
};
.filter(|overlay| {
overlay.is_over(Layout::new(&layout), cursor_position)
})
.map(|_| {
// TODO: Type-safe cursor availability
Point::new(-1.0, -1.0)
})
.unwrap_or(cursor_position);

self.overlay = Some(layout);

Expand Down

0 comments on commit efbf66b

Please sign in to comment.