From ebf839f37b7a91520d120912841f3af86499a286 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 30 Oct 2024 15:00:08 +0100 Subject: [PATCH] =?UTF-8?q?fix(process=5Fimage):=20sometimes=20last=20is?= =?UTF-8?q?=20nil=20=F0=9F=A4=B7=E2=80=8D=E2=99=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/concerns/attachment_image_processor_concern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/attachment_image_processor_concern.rb b/app/models/concerns/attachment_image_processor_concern.rb index 921d1c5bf..1457122a5 100644 --- a/app/models/concerns/attachment_image_processor_concern.rb +++ b/app/models/concerns/attachment_image_processor_concern.rb @@ -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