Work around panic

This commit is contained in:
Ian Douglas Scott 2023-12-12 11:59:32 -08:00
parent 89021e3b8b
commit 80e4fb0227
2 changed files with 27 additions and 612 deletions

View file

@ -60,6 +60,10 @@ impl ScreencopyHandler for AppData {
}
let mut buffer = capture.buffer.lock().unwrap();
if buffer.is_none() {
eprintln!("Error: No capture buffer?");
return;
}
let img = unsafe { buffer.as_mut().unwrap().to_image() };
let image = CaptureImage { img };
match &capture.source {