From ecd3c7377226690d4687fee522d75966c9faea00 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Sun, 25 Mar 2018 13:36:24 +0200 Subject: [PATCH] Skip asset if file is missing in protocol export [SCI-2250] --- app/controllers/protocols_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index d22485d96..495ff8f9a 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -739,6 +739,7 @@ class ProtocolsController < ApplicationController step_dir = "#{protocol_dir}/#{step_guid}" if step.assets.exists? step.assets.order(:id).each do |asset| + next unless asset.file.exists? asset_guid = get_guid(asset.id) asset_file_name = asset_guid.to_s + File.extname(asset.file_file_name).to_s