From: Eugen Rochko Date: Wed, 23 Dec 2020 06:47:03 +0000 (+0100) Subject: Fix trying to privatize empty media attachments (#15414) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=473abc35a19771304839dc57dc41ef309a826658;p=mastodon.git Fix trying to privatize empty media attachments (#15414) --- diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb index 19d65280d..22e519708 100644 --- a/app/services/suspend_account_service.rb +++ b/app/services/suspend_account_service.rb @@ -65,6 +65,8 @@ class SuspendAccountService < BaseService attachment = media_attachment.public_send(attachment_name) styles = [:original] | attachment.styles.keys + next if attachment.blank? + styles.each do |style| case Paperclip::Attachment.default_options[:storage] when :s3 diff --git a/app/services/unsuspend_account_service.rb b/app/services/unsuspend_account_service.rb index f07a3f053..be7ad9df3 100644 --- a/app/services/unsuspend_account_service.rb +++ b/app/services/unsuspend_account_service.rb @@ -56,6 +56,8 @@ class UnsuspendAccountService < BaseService attachment = media_attachment.public_send(attachment_name) styles = [:original] | attachment.styles.keys + next if attachment.blank? + styles.each do |style| case Paperclip::Attachment.default_options[:storage] when :s3