From be4fed8bd3494df853c1df254d62fe694721754b Mon Sep 17 00:00:00 2001 From: Fredrik Rundh Date: Fri, 29 Oct 2021 03:26:53 +0200 Subject: [PATCH] Check if PR body is null Fix TypeError when autolabeler body reqex is set and PR body is null/empty --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 80ac51c74..dc6996ca3 100644 --- a/index.js +++ b/index.js @@ -91,7 +91,7 @@ module.exports = (app, { getRouter }) => { } } // check pr body - if (!found && autolabel.body.length > 0) { + if (!found && context.payload.pull_request.body != null && autolabel.body.length > 0) { for (const matcher of autolabel.body) { if (context.payload.pull_request.body.match(matcher)) { labels.add(autolabel.label)