Skip to content

Commit

Permalink
Only set the window icon if we manage to get a primary window.
Browse files Browse the repository at this point in the history
  • Loading branch information
maaku committed Dec 8, 2023
1 parent 43b0111 commit f7065d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ fn set_window_icon(
primary_window: Query<Entity, With<PrimaryWindow>>,
) {
let primary_entity = primary_window.single();
let primary = windows.get_window(primary_entity).unwrap();
let Some(primary) = windows.get_window(primary_entity) else {
return;
};
let icon_buf = Cursor::new(include_bytes!(
"../build/macos/AppIcon.iconset/icon_256x256.png"
));
Expand Down

0 comments on commit f7065d6

Please sign in to comment.