diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 53e0fd6d4..337a25e6e 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -128,7 +128,12 @@ private # Checks that the file exists and is readable def file_readable - @attachment.readable? ? true : render_404 + if @attachment.readable? + true + else + logger.error "Cannot send attachment, #{@attachment.diskfile} does not exist or is unreadable." + render_404 + end end def read_authorize