Abiword: Avoid calling `stdoutCallback` multiple times

pull/4966/head
Richard Hansen 2021-03-19 03:42:31 -04:00 committed by John McLear
parent c208d50c4a
commit 0233399fdf
1 changed files with 4 additions and 1 deletions

View File

@ -55,7 +55,10 @@ if (os.type().indexOf('Windows') > -1) {
abiword.stderr.on('data', (data) => { stdoutBuffer += data.toString(); }); abiword.stderr.on('data', (data) => { stdoutBuffer += data.toString(); });
abiword.on('exit', (code) => { abiword.on('exit', (code) => {
spawnAbiword(); 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) => { abiword.stdout.on('data', (data) => {
stdoutBuffer += data.toString(); stdoutBuffer += data.toString();