Skip to content

Commit

Permalink
Merge pull request #16 from guihkx/avoid-crashes-in-process-scanner
Browse files Browse the repository at this point in the history
Avoid some crashes in the process scanner thread
  • Loading branch information
OpenByteDev authored Jul 17, 2024
2 parents debd4de + 0e7bd22 commit db8e453
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions burnt-sushi/src/spotify_process_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ impl SpotifyProcessScanner {
while let Some(event) = event_rx.recv().await {
// scoped to make future Send
let state = {
let window = event.window_handle().unwrap();
let process = get_window_process(window)?;
let Some(window) = event.window_handle() else {
continue;
};
let Ok(process) = get_window_process(window) else {
continue;
};
if !is_spotify_process(process.borrowed()) || !is_main_spotify_window(window) {
continue;
}
Expand Down

0 comments on commit db8e453

Please sign in to comment.