Skip to content

Commit

Permalink
Only set the window icon if we manage to get a primary window (resolves
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasEi committed Dec 3, 2023
1 parent d786f97 commit 5e4cb8a
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 @@ -37,7 +37,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 5e4cb8a

Please sign in to comment.