mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 08:42:44 +08:00
don't generate errors if 'upload_id' is invalid
This commit is contained in:
parent
9641d2413d
commit
4b7be137cb
|
@ -7,8 +7,8 @@ module Jobs
|
|||
|
||||
raise Discourse::InvalidParameters.new(:upload_id) if upload_id.blank?
|
||||
|
||||
upload = Upload.find(upload_id)
|
||||
user = User.find(args[:user_id] || upload.user_id)
|
||||
return unless upload = Upload.find_by(id: upload_id)
|
||||
return unless user = User.find(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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user