From 022c506eda8312015219d91348f318866383967c Mon Sep 17 00:00:00 2001 From: Nick Thomson Date: Sat, 24 Sep 2022 22:50:21 +0100 Subject: [PATCH] Possible fix for issue #1004 --- server/libs/nodeFfprobe/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/libs/nodeFfprobe/index.js b/server/libs/nodeFfprobe/index.js index a6d78233..ec52ef2a 100644 --- a/server/libs/nodeFfprobe/index.js +++ b/server/libs/nodeFfprobe/index.js @@ -20,7 +20,14 @@ module.exports = (function () { proc.on('exit', code => { exitCode = code }) 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); + } + }) }) }