From c3ad7bcaeeceb29802e0d4713169a1034cd0df4c Mon Sep 17 00:00:00 2001 From: David White Date: Fri, 26 Apr 2024 15:24:19 +0100 Subject: [PATCH] Add fix for early stream closure via pipeline (#109) Co-authored-by: David White --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index a27bbcc..b59d19b 100644 --- a/index.js +++ b/index.js @@ -44,6 +44,7 @@ exports.pack = function pack (cwd, opts) { } function onstat (err, filename, stat) { + if (pack.destroyed) return if (err) return pack.destroy(err) if (!filename) { if (opts.finalize !== false) pack.finalize()