Merge pull request #11030 from tchak/fix-image-processor-error

fix(process_image): sometimes last is nil 🤷‍♂️
This commit is contained in:
Paul Chavard 2024-11-07 20:50:49 +00:00 committed by GitHub
commit bc7f39a053
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,7 +19,7 @@ module AttachmentImageProcessorConcern
def process_image
return if blob.nil?
return if blob.attachments.size != 1
return if blob.attachments.last.record_type == "Export"
return if blob.attachments.any? { _1.record_type == "Export" }
return if !blob.content_type.in?(PROCESSABLE_TYPES)
return if blob.byte_size.zero? # some empty files may be considered as image depending on filename