electron: catch exceptions when saving init.json

See #1183
This commit is contained in:
Lorenz Hübschle-Schneider 2021-03-29 10:35:13 +02:00
parent 884bf1067d
commit 4d53d193fc
1 changed files with 5 additions and 1 deletions

View File

@ -61,7 +61,11 @@ function createWindow () {
let data = { let data = {
bounds: mainWindow.getBounds() 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. // Emitted when the window is closed.