From bdac8fdedca2bbabdf9d932eaa0cdd9531b3524b Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 14 Jun 2023 10:30:33 +0200 Subject: [PATCH] Don't log full stack trace when tray icons are not supported --- src/main/java/com/getpcpanel/util/TrayService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/getpcpanel/util/TrayService.java b/src/main/java/com/getpcpanel/util/TrayService.java index 538f7a5..6173af6 100644 --- a/src/main/java/com/getpcpanel/util/TrayService.java +++ b/src/main/java/com/getpcpanel/util/TrayService.java @@ -40,6 +40,10 @@ public void init() { var trayIconWidth = new TrayIcon(trayIconImage).getSize().width; trayIcon = new TrayIcon(trayIconImage.getScaledInstance(trayIconWidth, -1, 4)); trayDisabled = false; + } catch (UnsupportedOperationException e) { + log.warn("Tray icon is not supported"); + trayDisabled = true; + return; } catch (Exception e1) { log.error("Unable to initialize tray icon", e1); trayDisabled = true;