Skip to content

Commit

Permalink
Never fail if the taskbar icon cannot be set.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Sep 22, 2023
1 parent d182c05 commit 4afbdb1
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ public static SqueakDisplay create(final SqueakImageContext image) {

private static void tryToSetTaskbarIcon() {
if (Taskbar.isTaskbarSupported()) {
final Taskbar taskbar = Taskbar.getTaskbar();
if (taskbar.isSupported(Feature.ICON_IMAGE)) {
taskbar.setIconImage(Toolkit.getDefaultToolkit().getImage(SqueakDisplay.class.getResource("trufflesqueak-icon.png")));
try {
final Taskbar taskbar = Taskbar.getTaskbar();
if (taskbar.isSupported(Feature.ICON_IMAGE)) {
taskbar.setIconImage(Toolkit.getDefaultToolkit().getImage(SqueakDisplay.class.getResource("trufflesqueak-icon.png")));
}
} catch (Exception e) {
// Never fail if the taskbar icon cannot be set.
e.printStackTrace();
}
}
}
Expand Down

0 comments on commit 4afbdb1

Please sign in to comment.