From 122c8a5740f82d26afe2bd3c33fc11e086df95b0 Mon Sep 17 00:00:00 2001 From: Shivam Jadhav Date: Mon, 12 Aug 2024 13:47:29 +0530 Subject: [PATCH] Fixing issue https://github.com/patched-codes/patchwork/issues/58 --- patchwork/common/client/scm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/patchwork/common/client/scm.py b/patchwork/common/client/scm.py index 099f4e31c..93b76dfb2 100644 --- a/patchwork/common/client/scm.py +++ b/patchwork/common/client/scm.py @@ -342,10 +342,13 @@ def find_issue_by_id(self, slug: str, issue_id: int) -> IssueText | None: repo = self.github.get_repo(slug) try: issue = repo.get_issue(issue_id) + title = issue.title or "[No Title]" + body = issue.body or "[No Body]" + comments = [issue_comment.body or "[No Comment]" for issue_comment in issue.get_comments()] return dict( - title=issue.title, - body=issue.body, - comments=[issue_comment.body for issue_comment in issue.get_comments()], + title=title, + body=body, + comments=comments, ) except GithubException as e: logger.warn(f"Failed to get issue: {e}")