From e2a437cdbd35ec766708e7cccfaa81997ab0aa8c Mon Sep 17 00:00:00 2001 From: Max Anderson Date: Sun, 18 Apr 2021 18:53:12 -0700 Subject: [PATCH] Prevent unhandled exception when running via schedule (#69) * Prevent unhandled exception when running via schedule --- pull-request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pull-request.py b/pull-request.py index ac352c0..9b2ca7b 100755 --- a/pull-request.py +++ b/pull-request.py @@ -394,7 +394,7 @@ def main(): if not from_branch: print("PULL_REQUEST_FROM_BRANCH is not set, checking branch in payload.") with open(check_events_json(), "r") as fd: - from_branch = json.loads(fd.read()).get("ref") + from_branch = json.loads(fd.read()).get("ref", "") from_branch = from_branch.replace("refs/heads/", "").strip("/") else: print("PULL_REQUEST_FROM_BRANCH is set.")