diff --git a/resources/electron/electron-plugin/src/server/api/childProcess.ts b/resources/electron/electron-plugin/src/server/api/childProcess.ts index bcf0b5d..2e6c54f 100644 --- a/resources/electron/electron-plugin/src/server/api/childProcess.ts +++ b/resources/electron/electron-plugin/src/server/api/childProcess.ts @@ -195,9 +195,13 @@ function stopProcess(alias) { console.log('Process [' + alias + '] stopping with PID [' + proc.pid + '].'); - // @ts-ignore - killSync(proc.pid, 'SIGTERM', true); // Kill tree - proc.kill(); // Does not work but just in case. (do not put before killSync) + try { + // @ts-ignore + killSync(proc.pid, 'SIGTERM', true); // Kill tree + proc.kill(); // Does not work but just in case. (do not put before killSync) + } catch (e) { + console.log('Process [' + alias + '] already exited — nothing to kill.'); + } } export function stopAllProcesses() {