Fix error when saving bound-info.json

This commit is contained in:
Yuya Ochiai 2016-05-04 00:36:54 +09:00
parent 169debe07a
commit bc97163fd4

View file

@ -231,7 +231,12 @@ app.on('ready', function() {
var window_state = window.getBounds();
window_state.maximized = window.isMaximized();
window_state.fullscreen = window.isFullScreen();
fs.writeFileSync(bounds_info_path, JSON.stringify(window_state));
try {
fs.writeFileSync(bounds_info_path, JSON.stringify(window_state));
}
catch (e) {
// [Linux] error happens only when the window state is changed before the config dir is creatied.
}
};
mainWindow.on('close', function(event) {