Browse Source

fix: on error, reset spawnedProcess (#41033)

reset spawnedProcess instance in case of error
Maikel Ortega Hernández 1 year ago
parent
commit
a05bfd332d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lib/browser/api/auto-updater/squirrel-update-win.ts

+ 2 - 0
lib/browser/api/auto-updater/squirrel-update-win.ts

@@ -38,6 +38,8 @@ const spawnUpdate = async function (args: string[], options: { detached: boolean
     spawnedProcess.stderr.on('data', (data) => { stderr += data; });
 
     spawnedProcess.on('error', (error) => {
+      spawnedProcess = undefined;
+      spawnedArgs = [];
       reject(error);
     });