From 33e2869de9b944215cec8d798d85f2204c10ef26 Mon Sep 17 00:00:00 2001 From: Webb Scales Date: Tue, 10 Dec 2024 13:15:32 -0500 Subject: [PATCH] Exercise some paranoia accessing GH GraphQL return --- sync2jira/upstream_issue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync2jira/upstream_issue.py b/sync2jira/upstream_issue.py index 9e58a5e..1bfd34d 100644 --- a/sync2jira/upstream_issue.py +++ b/sync2jira/upstream_issue.py @@ -231,7 +231,7 @@ def add_project_values(issue, upstream, headers, config): orgname, reponame, issuenumber, response.text) return data = response.json() - gh_issue = data['data']['repository']['issue'] + gh_issue = data.get('data', {}).get('repository', {}).get('issue') if not gh_issue: log.debug("GitHub error while fetching issue %s/%s#%s: %s", orgname, reponame, issuenumber, response.text)