From e7a567d7bb0b08b7897a80e41600bce550acfaa6 Mon Sep 17 00:00:00 2001 From: kske 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(); }