From ac7f8db9d110dfe83f1caa9bc850e708a63351c7 Mon Sep 17 00:00:00 2001 From: Norman Perrin Date: Thu, 23 May 2024 08:53:21 +0200 Subject: [PATCH] fix(utils/tar): index access while match is null (#7555) --- lib/utils/tar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/tar.js b/lib/utils/tar.js index 31f8bb089ed85..1f978a8029f02 100644 --- a/lib/utils/tar.js +++ b/lib/utils/tar.js @@ -59,7 +59,7 @@ const getContents = async (manifest, tarball) => { totalEntries++ totalEntrySize += entry.size const p = entry.path - if (p.startsWith('package/node_modules/')) { + if (p.startsWith('package/node_modules/') && p !== 'package/node_modules/') { const name = p.match(/^package\/node_modules\/((?:@[^/]+\/)?[^/]+)/)[1] bundled.add(name) }