Fixed nullpointer issue when there is no icon file specified
This commit is contained in:
parent
37144a03c9
commit
52197ae301
@ -116,11 +116,13 @@ class TrayPopup extends JPopupMenu {
|
|||||||
this.iconFile = imageFile;
|
this.iconFile = imageFile;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Image image = new ImageIcon(ImageIO.read(imageFile)).getImage();
|
if (imageFile != null) {
|
||||||
image.flush();
|
Image image = new ImageIcon(ImageIO.read(imageFile)).getImage();
|
||||||
|
image.flush();
|
||||||
|
|
||||||
// we set the dialog window to have the same icon as what is on the system tray
|
// we set the dialog window to have the same icon as what is on the system tray
|
||||||
hiddenDialog.setIconImage(image);
|
hiddenDialog.setIconImage(image);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
SystemTray.logger.error("Error setting the title-bar image for the popup menu task tray dialog");
|
SystemTray.logger.error("Error setting the title-bar image for the popup menu task tray dialog");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user