Console: Catch error checking systray availability (gitlab issue !331)

This commit is contained in:
zzz
2021-08-28 09:05:38 -04:00
parent dabc29f8a5
commit a66422fa3c

View File

@@ -203,8 +203,14 @@ public class ConfigServiceHandler extends FormHandler {
* @since 0.9.26
*/
public boolean shouldShowSystray() {
return SystemTray.isSupported() &&
!SystemVersion.isService() &&
try {
if (!SystemTray.isSupported())
return false;
} catch (Throwable t) {
// java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
return false;
}
return !SystemVersion.isService() &&
!(SystemVersion.isWindows() && _context.hasWrapper() && WrapperManager.isLaunchedAsService());
}