Don't raise an error if user has been destroyed.

This commit is contained in:
Guo Xiang Tan 2017-09-30 09:09:12 +08:00
parent d5d66e969e
commit 4eeb6014f4
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ module Jobs
raise Discourse::InvalidParameters.new(:upload_id) if upload_id.blank?
return unless upload = Upload.find_by(id: upload_id)
return unless user = User.find(args[:user_id] || upload.user_id)
return unless user = User.find_by(args[:user_id] || upload.user_id)
Discourse.avatar_sizes.each do |size|
OptimizedImage.create_for(upload, size, size, filename: upload.original_filename, allow_animation: SiteSetting.allow_animated_avatars)