From 85d847e91f314f5ff6b660c1b6faa6f224af5728 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Tue, 2 Mar 2021 22:06:27 +0100
Subject: [PATCH] fix: defensive non null check for updated remediation

---
 lib/manager/npm/update/locked-dependency/index.ts | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/manager/npm/update/locked-dependency/index.ts b/lib/manager/npm/update/locked-dependency/index.ts
index e10627aab4..1d3652a73d 100644
--- a/lib/manager/npm/update/locked-dependency/index.ts
+++ b/lib/manager/npm/update/locked-dependency/index.ts
@@ -178,10 +178,12 @@ export async function updateLockedDependency(
       }
       newPackageJsonContent =
         parentUpdateResult[packageFile] || newPackageJsonContent;
-      newLockFileContent = parentUpdateResult[lockFile];
+      newLockFileContent = parentUpdateResult[lockFile] || newLockFileContent;
     }
     const files = {};
-    files[lockFile] = newLockFileContent;
+    if (newLockFileContent) {
+      files[lockFile] = newLockFileContent;
+    }
     if (newPackageJsonContent) {
       files[packageFile] = newPackageJsonContent;
     }
-- 
GitLab