electron: catch exceptions when saving init.json

See #1183
codeql
Lorenz Hübschle-Schneider 4 years ago
parent 884bf1067d
commit 4d53d193fc
  1. 6
      src/electron-main.js

@ -61,7 +61,11 @@ function createWindow () {
let data = {
bounds: mainWindow.getBounds()
}
fs.writeFileSync(initPath, JSON.stringify(data))
try {
fs.writeFileSync(initPath, JSON.stringify(data));
} catch (e) {
console.log('Unable to save save init.json: ', e);
}
})
// Emitted when the window is closed.

Loading…
Cancel
Save