From c939486ce68c133ca17cee1bd94eb341b71632a0 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 6 Dec 2023 15:35:25 -0800 Subject: [PATCH] Fix a panic --- src/wayland/screencopy.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); } }