From db5b08f7f0c61a8c3f584d4dd0a257e7171f8b67 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 2 Aug 2023 10:34:27 +0200 Subject: [PATCH] fix(npm): handle null lockfile after update --- lib/modules/manager/npm/post-update/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/manager/npm/post-update/index.ts b/lib/modules/manager/npm/post-update/index.ts index 5fa20722a8b18bf..537af047a7d12a9 100644 --- a/lib/modules/manager/npm/post-update/index.ts +++ b/lib/modules/manager/npm/post-update/index.ts @@ -593,7 +593,7 @@ export async function getAdditionalFiles( lockFile: npmLock, stderr: res.stderr, }); - } else { + } else if (res.lockFile) { const existingContent = await getFile( npmLock, config.reuseExistingBranch ? config.branchName : config.baseBranch @@ -607,7 +607,7 @@ export async function getAdditionalFiles( path: npmLock, // TODO: can this be undefined? (#7154) - contents: res.lockFile!.replace(tokenRe, ''), + contents: res.lockFile.replace(tokenRe, ''), }); } }