Skip to content

Commit

Permalink
add try-catch in window closed event
Browse files Browse the repository at this point in the history
  • Loading branch information
mayswind committed May 28, 2019
1 parent d0f2604 commit ad89df5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,18 @@ app.on('ready', () => {
});

core.mainWindow.on('closed', () => {
if (!config.maximized) {
config.save('width');
config.save('height');
config.save('x');
config.save('y');
}
try {
if (!config.maximized) {
config.save('width');
config.save('height');
config.save('x');
config.save('y');
}

config.save('maximized');
config.save('maximized');
} catch (ex) {
; // Do Nothing
}

core.mainWindow = null;
});
Expand Down

0 comments on commit ad89df5

Please sign in to comment.