Skip to content

Commit

Permalink
Merge pull request #325 from github/catch-type-error
Browse files Browse the repository at this point in the history
  • Loading branch information
zkoppert authored Jun 25, 2024
2 parents 0958b56 + 1affdcf commit 2af47be
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions time_to_ready_for_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ def get_time_to_ready_for_review(
return None

events = issue.issue.events(number=50)
for event in events:
if event.event == "ready_for_review":
return event.created_at
try:
for event in events:
if event.event == "ready_for_review":
return event.created_at
except TypeError as e:
print(
f"An error occurred processing review events. Perhaps issue contains a ghost user. {e}"
)
return None

return None

0 comments on commit 2af47be

Please sign in to comment.