From e7f899c09d7c9b815ec323b6c4f674a2ac7629ad Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Tue, 12 Mar 2024 17:04:34 +0100 Subject: [PATCH] JS Build: Fix watch exits when encountering an error --- js-build/watch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js-build/watch.js b/js-build/watch.js index 842e651f9e..f7740348b4 100644 --- a/js-build/watch.js +++ b/js-build/watch.js @@ -102,6 +102,7 @@ async function processFile(path) { } } catch (err) { + onError(err); result = false; } return result; @@ -116,7 +117,7 @@ async function processFiles(mutex) { let t2 = Date.now(); let aggrResult; - if (results.length === 1) { + if (results.length === 1 && results[0]) { onSuccess(results[0]); aggrResult = results[0]; } @@ -140,7 +141,7 @@ async function processFiles(mutex) { onSuccess(await cleanUp(signatures)); - if (shouldAddOmni && aggrResult.outFiles?.length) { + if (shouldAddOmni && aggrResult?.outFiles?.length) { onSuccess(await addOmniFiles(aggrResult.outFiles)); } }