From bc97163fd4e5def5d3949bdd1306c74a07729397 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Wed, 4 May 2016 00:36:54 +0900 Subject: [PATCH] Fix error when saving bound-info.json --- src/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 77beb9cd..c0b33f19 100644 --- a/src/main.js +++ b/src/main.js @@ -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) {