Skip to content

Commit

Permalink
fixing minor issue in scrap_regex_from_issue method
Browse files Browse the repository at this point in the history
  • Loading branch information
gkowalc committed Feb 3, 2024
1 parent a100d4f commit 2e8e1b0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,15 +1548,16 @@ def scrap_regex_from_issue(self, issue, regex):
comments = issue_output["fields"]["comment"]["comments"]

try:
description_matches = [x.group(0) for x in re.finditer(regex, description)]
if description_matches:
regex_output.extend(description_matches)

for comment in comments:
comment_html = comment["body"]
comment_matches = [x.group(0) for x in re.finditer(regex, comment_html)]
if comment_matches:
regex_output.extend(comment_matches)
if description is not None:
description_matches = [x.group(0) for x in re.finditer(regex, description)]
if description_matches:
regex_output.extend(description_matches)

for comment in comments:
comment_html = comment["body"]
comment_matches = [x.group(0) for x in re.finditer(regex, comment_html)]
if comment_matches:
regex_output.extend(comment_matches)

return regex_output
except HTTPError as e:
Expand Down

1 comment on commit 2e8e1b0

@gkowalc
Copy link
Contributor

@gkowalc gkowalc commented on 2e8e1b0 Feb 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible to create page with empty page description field. Added a condition to prevent NoneType error

Please sign in to comment.