From 10b1cc0001e66cd1d2afe08ea6f6ad347b2d2206 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Sat, 7 Dec 2019 21:14:55 +0100 Subject: [PATCH] Silent failure when StatusTrayIcon is not supported on a platform --- src/main/java/envoy/client/ui/Startup.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/envoy/client/ui/Startup.java b/src/main/java/envoy/client/ui/Startup.java index 25af819..edd5aa2 100644 --- a/src/main/java/envoy/client/ui/Startup.java +++ b/src/main/java/envoy/client/ui/Startup.java @@ -71,12 +71,17 @@ public class Startup { JOptionPane.WARNING_MESSAGE); } Settings.getInstance().setUsername(userName); - + EventQueue.invokeLater(() -> { try { ChatWindow chatWindow = new ChatWindow(client, localDB); - new StatusTrayIcon(chatWindow).show(); chatWindow.setVisible(true); + + try { + new StatusTrayIcon(chatWindow).show(); + } catch (EnvoyException e) { + logger.warning("The StatusTrayIcon is not supported on this platform!"); + } } catch (Exception e) { e.printStackTrace(); }