To prevent crashes, catch thrown error from tray.setIcon

This commit is contained in:
Scott Nonnenberg 2019-06-10 14:41:05 -07:00 committed by Ken Powers
parent 9fd867fdd1
commit ca1e6c3ccd

View file

@ -95,7 +95,14 @@ function createTrayIcon(getMainWindow, messages) {
console.log('tray.updateIcon: Image for tray update does not exist!');
return;
}
tray.setImage(image);
try {
tray.setImage(image);
} catch (error) {
console.log(
'tray.setImage error:',
error && error.stack ? error.stack : error
);
}
};
tray.on('click', tray.showWindow);