Skip to content

Commit

Permalink
Check existence of window
Browse files Browse the repository at this point in the history
  • Loading branch information
akimakinai committed Sep 8, 2024
1 parent 11979fb commit 6f679ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/window/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ fn screenshot_saving(
screenshot_saving: Query<Entity, With<Capturing>>,
windows: Query<Entity, With<Window>>,
) {
let window = windows.single();
let Ok(window) = windows.get_single() else {
return;
};
match screenshot_saving.iter().count() {
0 => {
commands.entity(window).remove::<CursorIcon>();
Expand Down

0 comments on commit 6f679ca

Please sign in to comment.