From 77b0fc4691b35c9215c65489606001ff4894bde0 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 26 Sep 2016 23:38:04 +0200 Subject: [PATCH] Added vounds checking for FORCE_TRAY_TYPE --- src/dorkbox/systemTray/SystemTray.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dorkbox/systemTray/SystemTray.java b/src/dorkbox/systemTray/SystemTray.java index 3c205d7..a3bac79 100644 --- a/src/dorkbox/systemTray/SystemTray.java +++ b/src/dorkbox/systemTray/SystemTray.java @@ -115,7 +115,7 @@ class SystemTray { *

* This is an advanced feature, and it is recommended to leave at 0. */ - public static int FORCE_TRAY_TYPE = 0; + public static int FORCE_TRAY_TYPE = 3; @Property /** @@ -243,6 +243,10 @@ class SystemTray { } } + if (FORCE_TRAY_TYPE < 0 || FORCE_TRAY_TYPE > 3) { + throw new RuntimeException("Invalid option for FORCE_TRAY_TYPE: " + FORCE_TRAY_TYPE); + } + if (DEBUG) { switch (FORCE_TRAY_TYPE) { case 1: logger.debug("Forced tray type: GtkStatusIcon"); break;