Added a verification to avoid the error while quitting the app.

This commit is contained in:
Hubert committed 2023-08-03 15:45:07 -03:00
1 parent ea7c7f6447
commit 4fc44cd952
1 file changed
+1 -1
+1 -1
View File
@@ -174,7 +174,7 @@ export default class ElectronAppWrapper {
// so that it can tell us if we can really close the app or not. // so that it can tell us if we can really close the app or not.
// Search for "appClose" event for closing logic on renderer side. // Search for "appClose" event for closing logic on renderer side.
event.preventDefault(); event.preventDefault();
this.win_.webContents.send('appClose'); if (this.win_) this.win_.webContents.send('appClose');
} else { } else {
// If the renderer process has responded, check if we can close or not // If the renderer process has responded, check if we can close or not
if (this.rendererProcessQuitReply_.canClose) { if (this.rendererProcessQuitReply_.canClose) {