Skip to content

Commit

Permalink
#5518: handling panic in copy_and_paste.rs line 105 (#6004)
Browse files Browse the repository at this point in the history
* #5518: handling panic in copy_and_paste.rs line 105

Co-authored-by: Wez Furlong <[email protected]>
  • Loading branch information
rengare and wez authored Sep 14, 2024
1 parent fed0e39 commit 137a97b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions window/src/os/wayland/copy_and_paste.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,9 @@ impl CopyAndPaste {
impl WaylandState {
pub(super) fn resolve_copy_and_paste(&mut self) -> Option<Arc<Mutex<CopyAndPaste>>> {
let active_surface_id = self.active_surface_id.borrow();
let active_surface_id = active_surface_id.as_ref().unwrap();
if let Some(pending) = self.surface_to_pending.get(&active_surface_id) {
Some(Arc::clone(&pending.lock().unwrap().copy_and_paste))
} else {
None
}
let active_surface_id = active_surface_id.as_ref()?;
let pending = self.surface_to_pending.get(&active_surface_id)?;
Some(Arc::clone(&pending.lock().unwrap().copy_and_paste))
}
}

Expand Down

0 comments on commit 137a97b

Please sign in to comment.