fix(process_image): sometimes last is nil 🤷‍♂️

This commit is contained in:
Paul Chavard 2024-10-30 15:00:08 +01:00
parent ae7260829d
commit ebf839f37b
No known key found for this signature in database

View file

@ -19,7 +19,7 @@ module AttachmentImageProcessorConcern
def process_image def process_image
return if blob.nil? return if blob.nil?
return if blob.attachments.size != 1 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.content_type.in?(PROCESSABLE_TYPES)
return if blob.byte_size.zero? # some empty files may be considered as image depending on filename return if blob.byte_size.zero? # some empty files may be considered as image depending on filename