From a26bd2c549c7688015d77c3606362bb327658db6 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 14 Apr 2016 11:52:26 -0400 Subject: [PATCH] FIX: If the user can't be found to award a badge, skip them --- app/jobs/onceoff/grant_onebox.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/jobs/onceoff/grant_onebox.rb b/app/jobs/onceoff/grant_onebox.rb index 131d29a167c..113f2e542c6 100644 --- a/app/jobs/onceoff/grant_onebox.rb +++ b/app/jobs/onceoff/grant_onebox.rb @@ -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