From 33ca9d9aed458e5a0f3c25f263ea5f071f8ef7a5 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Thu, 4 Jun 2020 18:02:21 +0200
Subject: [PATCH] fix: check prFiles before every

Closes #6432
---
 lib/workers/pr/code-owners.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/workers/pr/code-owners.ts b/lib/workers/pr/code-owners.ts
index b7062a7402..1f5090e39d 100644
--- a/lib/workers/pr/code-owners.ts
+++ b/lib/workers/pr/code-owners.ts
@@ -31,7 +31,7 @@ export async function codeOwnersForPr(pr: Pr): Promise<string[]> {
       })
       .reverse();
 
-    const matchingRule = rules.find((rule) => prFiles.every(rule.match));
+    const matchingRule = rules.find((rule) => prFiles?.every(rule.match));
     if (!matchingRule) {
       return [];
     }
-- 
GitLab