diff --git a/src/wayland/screencopy.rs b/src/wayland/screencopy.rs index 01f1881..38ad1ee 100644 --- a/src/wayland/screencopy.rs +++ b/src/wayland/screencopy.rs @@ -89,8 +89,11 @@ impl ScreencopyHandler for AppData { ) { // TODO println!("Failed"); - let capture = Capture::for_session(session).unwrap(); - capture.cancel(); + if let Some(capture) = Capture::for_session(session) { + capture.cancel(); + } else { + println!("Capture not found?") + } session.destroy(); } }