From bd1e81f89498014fc0e6544152654def18255a6c Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 17 Jul 2023 12:06:37 +0200 Subject: [PATCH] Fix preview generation [SCI-8855] --- .../active_storage/representations/redirect_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/active_storage/representations/redirect_controller.rb b/app/controllers/active_storage/representations/redirect_controller.rb index 2cfbe5ea2..b6735f826 100644 --- a/app/controllers/active_storage/representations/redirect_controller.rb +++ b/app/controllers/active_storage/representations/redirect_controller.rb @@ -29,7 +29,8 @@ module ActiveStorage preview_exists = if @blob.variable? - @blob.service.exist?(@blob.representation(params['variation_key']).key) + rep_key = @blob.representation(params['variation_key']).key + rep_key && @blob.service.exist?(rep_key) else @blob.preview(params['variation_key']).image.attached? end