diff --git a/src/node/utils/Abiword.js b/src/node/utils/Abiword.js index 07abf26c0..1ed487ae1 100644 --- a/src/node/utils/Abiword.js +++ b/src/node/utils/Abiword.js @@ -55,7 +55,10 @@ if (os.type().indexOf('Windows') > -1) { abiword.stderr.on('data', (data) => { stdoutBuffer += data.toString(); }); abiword.on('exit', (code) => { spawnAbiword(); - if (stdoutCallback != null) stdoutCallback(new Error(`Abiword died with exit code ${code}`)); + if (stdoutCallback != null) { + stdoutCallback(new Error(`Abiword died with exit code ${code}`)); + stdoutCallback = null; + } }); abiword.stdout.on('data', (data) => { stdoutBuffer += data.toString();