@@ -984,7 +984,8 @@ def gather_insights(self, repo, insights, since, show_closed_metric=False):
984984 if issue ["state" ] == "open" :
985985 if created > since :
986986 insights ["new_prs" ] += 1
987- insights ["pr_authors" ].add (pr_info ["user" ]["login" ])
987+ if pr_info ["user" ]:
988+ insights ["pr_authors" ].add (pr_info ["user" ]["login" ])
988989 insights ["active_prs" ] += 1
989990 else :
990991 merged = datetime .datetime .strptime (
@@ -1031,7 +1032,10 @@ def gather_insights(self, repo, insights, since, show_closed_metric=False):
10311032 pr_reviews = gh_reqs .get (str (pr_info ["url" ]) + "/reviews" )
10321033 if pr_reviews .ok :
10331034 for review in pr_reviews .json ():
1034- if review ["state" ].lower () == "approved" :
1035+ if (
1036+ review ["state" ].lower () == "approved"
1037+ and review ["user" ]
1038+ ):
10351039 insights ["pr_reviewers" ].add (
10361040 review ["user" ]["login" ]
10371041 )
@@ -1043,12 +1047,14 @@ def gather_insights(self, repo, insights, since, show_closed_metric=False):
10431047 if issue ["state" ] == "open" :
10441048 if created > since :
10451049 insights ["new_issues" ] += 1
1046- insights ["issue_authors" ].add (issue_info ["user" ]["login" ])
1050+ if issue_info ["user" ]:
1051+ insights ["issue_authors" ].add (issue_info ["user" ]["login" ])
10471052 insights ["active_issues" ] += 1
10481053
10491054 else :
10501055 insights ["closed_issues" ] += 1
1051- insights ["issue_closers" ].add (issue_info ["closed_by" ]["login" ])
1056+ if issue_info ["closed_by" ]:
1057+ insights ["issue_closers" ].add (issue_info ["closed_by" ]["login" ])
10521058
10531059 params = {"state" : "open" , "per_page" : 100 }
10541060 issues = self .github_get_all_pages (
0 commit comments