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) {
|
||||
if (trayIcon != null) {
|
||||
switch (iconid) {
|
||||
case 1:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_syncing_time-alt.png"));
|
||||
break;
|
||||
case 2:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_minting.png"));
|
||||
break;
|
||||
case 3:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_syncing.png"));
|
||||
break;
|
||||
case 4:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_synced.png"));
|
||||
break;
|
||||
try {
|
||||
switch (iconid) {
|
||||
case 1:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_syncing_time-alt.png"));
|
||||
break;
|
||||
case 2:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_minting.png"));
|
||||
break;
|
||||
case 3:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/qortal_ui_tray_syncing.png"));
|
||||
break;
|
||||
case 4:
|
||||
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