diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 653400cbe..16e6ea870 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -41,7 +41,7 @@ class ZipdownController < ApplicationController if homework != nil if homework.attachments.count > 0 zipfile = zip_homework_by_user homework - send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if zipfile + send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) else render_403 :message => :no_file_dowmload end @@ -51,6 +51,8 @@ class ZipdownController < ApplicationController else render_403 :message => :notice_not_authorized end + rescue => e + render file: 'public/file_not_found.html' end private