mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-24 19:56:37 +00:00
Return to avoid any further code execution after an elevation error
Turns out that even by using `process.exit(1)`, the electron main process doesn't exit instantly, but continues executing code. This causes electron to throw on `electron.globalShortcut` because this functionality is not available given that we didn't create a renderer view. Fixes: https://github.com/resin-io/etcher/issues/215
This commit is contained in:
parent
34147fb4cb
commit
f530dfcc3c
@ -32,7 +32,7 @@ electron.app.on('ready', function() {
|
|||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
electron.dialog.showErrorBox('Elevation Error', error.message);
|
electron.dialog.showErrorBox('Elevation Error', error.message);
|
||||||
process.exit(1);
|
return process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
mainWindow = new electron.BrowserWindow({
|
mainWindow = new electron.BrowserWindow({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user