From e3a23116d2cba322d09dd3c155ddcdc652ee430e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 20 Feb 2019 22:34:43 +0100 Subject: [PATCH] FIX: don't update gravatar if the user has no email --- app/jobs/regular/update_gravatar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/regular/update_gravatar.rb b/app/jobs/regular/update_gravatar.rb index 53d4f61a4f4..e993c0b3a7d 100644 --- a/app/jobs/regular/update_gravatar.rb +++ b/app/jobs/regular/update_gravatar.rb @@ -8,7 +8,7 @@ module Jobs user = User.find_by(id: args[:user_id]) avatar = UserAvatar.find_by(id: args[:avatar_id]) - if user && avatar && avatar.user&.id == user.id + if user && avatar && avatar.user&.id == user.id && user.email.present? avatar.update_gravatar! if !user.uploaded_avatar_id && avatar.gravatar_upload_id user.update_column(:uploaded_avatar_id, avatar.gravatar_upload_id)