@@ -984,7 +984,8 @@ def gather_insights(self, repo, insights, since, show_closed_metric=False):
984
984
if issue ["state" ] == "open" :
985
985
if created > since :
986
986
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" ])
988
989
insights ["active_prs" ] += 1
989
990
else :
990
991
merged = datetime .datetime .strptime (
@@ -1031,7 +1032,10 @@ def gather_insights(self, repo, insights, since, show_closed_metric=False):
1031
1032
pr_reviews = gh_reqs .get (str (pr_info ["url" ]) + "/reviews" )
1032
1033
if pr_reviews .ok :
1033
1034
for review in pr_reviews .json ():
1034
- if review ["state" ].lower () == "approved" :
1035
+ if (
1036
+ review ["state" ].lower () == "approved"
1037
+ and review ["user" ]
1038
+ ):
1035
1039
insights ["pr_reviewers" ].add (
1036
1040
review ["user" ]["login" ]
1037
1041
)
@@ -1043,12 +1047,14 @@ def gather_insights(self, repo, insights, since, show_closed_metric=False):
1043
1047
if issue ["state" ] == "open" :
1044
1048
if created > since :
1045
1049
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" ])
1047
1052
insights ["active_issues" ] += 1
1048
1053
1049
1054
else :
1050
1055
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" ])
1052
1058
1053
1059
params = {"state" : "open" , "per_page" : 100 }
1054
1060
issues = self .github_get_all_pages (
0 commit comments