From 0233399fdf222dba625a78fe1948e38bdae12e92 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 19 Mar 2021 03:42:31 -0400 Subject: [PATCH] Abiword: Avoid calling `stdoutCallback` multiple times --- src/node/utils/Abiword.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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();