From 60f54f8a5ab6416641c0b54965647d7f2b167370 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@keylocation.sg>
Date: Thu, 14 Sep 2017 13:56:09 +0200
Subject: [PATCH] fix: Check for package.json name first (#805)

---
 lib/workers/branch/lock-files.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/workers/branch/lock-files.js b/lib/workers/branch/lock-files.js
index 7ae4f262c9..1efc267ddc 100644
--- a/lib/workers/branch/lock-files.js
+++ b/lib/workers/branch/lock-files.js
@@ -102,7 +102,7 @@ async function writeExistingFiles(config) {
       logger.debug(`Writing package.json to ${basedir}`);
       // Massage the file to eliminate yarn errors
       const massagedFile = { ...packageFile.content };
-      if (!massagedFile.name.match(/^[0-9a-z-_]+$/)) {
+      if (massagedFile.name && !massagedFile.name.match(/^[0-9a-z-_]+$/)) {
         massagedFile.name = 'dummy';
       }
       delete massagedFile.engines;
-- 
GitLab