diff --git a/app/controllers/downloads_controller.rb b/app/controllers/downloads_controller.rb index 4f81dfc1..be3019cf 100644 --- a/app/controllers/downloads_controller.rb +++ b/app/controllers/downloads_controller.rb @@ -18,6 +18,8 @@ def send_audio_file_as_attachment disposition: "attachment", filename: "Phish #{track.show.date} #{track.title}.mp3", length: track.audio_file.size + rescue ActionController::MissingFile + head :not_found end def send_blob_file_inline @@ -28,6 +30,8 @@ def send_blob_file_inline disposition: "inline", filename: blob.filename.to_s, length: blob.byte_size + rescue ActionController::MissingFile + head :not_found end def track