forked from Qortal/qortal
Catch occasional NPE when setting tray icon.
This commit is contained in:
parent
5b85f01427
commit
8bb5077e76
@ -291,19 +291,23 @@ public class SysTray {
|
|||||||
|
|
||||||
public void setTrayIcon(int iconid) {
|
public void setTrayIcon(int iconid) {
|
||||||
if (trayIcon != null) {
|
if (trayIcon != null) {
|
||||||
switch (iconid) {
|
try {
|
||||||
case 1:
|
switch (iconid) {
|
||||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_syncing_time-alt.png"));
|
case 1:
|
||||||
break;
|
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_syncing_time-alt.png"));
|
||||||
case 2:
|
break;
|
||||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_minting.png"));
|
case 2:
|
||||||
break;
|
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_minting.png"));
|
||||||
case 3:
|
break;
|
||||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_syncing.png"));
|
case 3:
|
||||||
break;
|
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_syncing.png"));
|
||||||
case 4:
|
break;
|
||||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_synced.png"));
|
case 4:
|
||||||
break;
|
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_synced.png"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
LOGGER.info("Unable to set tray icon");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user