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

View File

@@ -30,7 +30,8 @@ module Jobs
badge = Badge.find(Badge::FirstOnebox)
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