From 48f2b5a2e165b49b62fbb1e349c818c8fb67c4ac Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@keylocation.sg>
Date: Thu, 19 Oct 2017 17:29:12 +0200
Subject: [PATCH] fix: add check for base before comparing sha (#997)

---
 lib/api/github.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/api/github.js b/lib/api/github.js
index 9e4cda7757..1b768922be 100644
--- a/lib/api/github.js
+++ b/lib/api/github.js
@@ -635,7 +635,7 @@ async function getPr(prNo) {
         pr.canRebase = true;
       }
     }
-    if (pr.base.sha !== config.baseCommitSHA) {
+    if (!pr.base || pr.base.sha !== config.baseCommitSHA) {
       pr.isStale = true;
     }
   }
-- 
GitLab