Possible fix for issue #1004

This commit is contained in:
Nick Thomson 2022-09-24 22:50:21 +01:00
parent 0ef2a2e4b6
commit 022c506eda

View File

@ -20,7 +20,14 @@ module.exports = (function () {
proc.on('exit', code => { exitCode = code }) proc.on('exit', code => { exitCode = code })
proc.on('error', err => reject(err)) proc.on('error', err => reject(err))
proc.on('close', () => resolve(JSON.parse(probeData.join('')))) proc.on('close', () => {
try {
let result = JSON.parse(probeData.join(''))
resolve(result);
} catch (err) {
reject(err);
}
})
}) })
} }