From cfe6fc359ac985b8a464909463ff0bf1364560e4 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sun, 11 Oct 2020 12:09:58 -0500 Subject: Skip empty style keys --- app/services/suspend_account_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb index 32b46f0e1..7ad4777ee 100644 --- a/app/services/suspend_account_service.rb +++ b/app/services/suspend_account_service.rb @@ -37,6 +37,8 @@ class SuspendAccountService < BaseService styles = [:original] | attachment.styles.keys styles.each do |style| + next if attachment.path(style).blank? + case Paperclip::Attachment.default_options[:storage] when :s3 attachment.s3_object(style).acl.put({ acl: 'private' }) -- cgit