mirror of
https://github.com/Qortal/qortal.git
synced 2025-11-02 02:17:03 +00:00
Catch SystemTray.isSupported errors (and act as if no support).
Symptoms were on Ubuntu with 8u222:
Exception in thread "Controller" java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper
at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886)
at java.awt.SystemTray.isSupported(SystemTray.java:219)
at org.qora.gui.SysTray.<init>(SysTray.java:50)
at org.qora.gui.SysTray.getInstance(SysTray.java:249)
at org.qora.controller.Controller.updateSysTray(Controller.java:480)
at org.qora.controller.Controller.run(Controller.java:368)
(Underlying cause not known)
This would cause Controller thread to silently exit, and so no
synchronization would occur. Node would still have connections
and thus happily generate its own blocks on its on fork.
Maybe other peers would try to sync with this node but would
likely reject this node's chain after a short while.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.qora.gui;
|
||||
|
||||
import java.awt.AWTError;
|
||||
import java.awt.AWTException;
|
||||
import java.awt.SystemTray;
|
||||
import java.awt.TrayIcon;
|
||||
@@ -46,8 +47,13 @@ public class SysTray {
|
||||
private JDialog hiddenDialog = null;
|
||||
|
||||
private SysTray() {
|
||||
if (!SystemTray.isSupported())
|
||||
try {
|
||||
if (!SystemTray.isSupported())
|
||||
return;
|
||||
} catch (AWTError e) {
|
||||
// Even SystemTray.isSupported can fail, so catch that too
|
||||
return;
|
||||
}
|
||||
|
||||
LOGGER.info("Launching system tray icon");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user