From e6c411684f851165464594e2a6731cf72d966b19 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 9 Sep 2020 14:58:09 +1000 Subject: [PATCH] Don't fail on missing images when resizing The changed code obtains the image dimensions when you first upload an image. Unfortunately it's also triggered when thumbnails are refreshed. That doesn't change the size of the original image though. --- app/models/spree/image.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/spree/image.rb b/app/models/spree/image.rb index 24d20aeb93..ce9b03d9a2 100644 --- a/app/models/spree/image.rb +++ b/app/models/spree/image.rb @@ -34,6 +34,8 @@ module Spree end def find_dimensions + return if attachment.errors.present? + temporary = attachment.queued_for_write[:original] filename = temporary.path unless temporary.nil? filename = attachment.path if filename.blank?