Skip to content

Commit f904102

Browse files
committed
adding the same sanity check to all the queries
1 parent 463aa1c commit f904102

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

api/ruby/find-inactive-members/find_inactive_members.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ def issue_activity(repo, date=@date)
134134
# get all issues after specified date and iterate
135135
info "...Issues"
136136
@client.list_issues(repo, { :since => date }).each do |issue|
137+
# if there's no user (ghost user?) then skip this // THIS NEEDS BETTER VALIDATION
138+
if comment["user"].nil?
139+
next
140+
end
137141
# if creator is a member of the org and not active, make active
138142
if t = @members.find {|member| member[:login] == issue["user"]["login"] && member[:active] == false }
139143
make_active(t[:login])
@@ -145,6 +149,10 @@ def issue_comment_activity(repo, date=@date)
145149
# get all issue comments after specified date and iterate
146150
info "...Issue comments"
147151
@client.issues_comments(repo, { :since => date }).each do |comment|
152+
# if there's no user (ghost user?) then skip this // THIS NEEDS BETTER VALIDATION
153+
if comment["user"].nil?
154+
next
155+
end
148156
# if commenter is a member of the org and not active, make active
149157
if t = @members.find {|member| member[:login] == comment["user"]["login"] && member[:active] == false }
150158
make_active(t[:login])

0 commit comments

Comments
 (0)