FIX: If the user can't be found to award a badge, skip them

This commit is contained in:
Robin Ward 2016-04-14 11:52:26 -04:00
parent 976056bc41
commit a26bd2c549
No known key found for this signature in database
GPG Key ID: 0E091E2B4ED1B83D
1 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,8 @@ module Jobs
badge = Badge.find(Badge::FirstOnebox) badge = Badge.find(Badge::FirstOnebox)
to_award.each do |user_id, opts| to_award.each do |user_id, opts|
BadgeGranter.grant(badge, User.find(user_id), opts) user = User.where(id: user_id).first
BadgeGranter.grant(badge, user, opts) if user
end end
end end