From 65826ab3a672ffcbff1bb0d5594015f5c078acd0 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 19 Aug 2014 17:26:20 +1000 Subject: [PATCH] FIX: only update column if we have a user --- app/jobs/regular/update_top_redirection.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/jobs/regular/update_top_redirection.rb b/app/jobs/regular/update_top_redirection.rb index 97df9483d6..b682fe924e 100644 --- a/app/jobs/regular/update_top_redirection.rb +++ b/app/jobs/regular/update_top_redirection.rb @@ -4,7 +4,9 @@ module Jobs def execute(args) user = User.find_by(id: args[:user_id]) - user.update_column(:last_redirected_to_top_at, args[:redirected_at]) + if user + user.update_column(:last_redirected_to_top_at, args[:redirected_at]) + end end end