diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 633ffd8ed..09b76781f 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -76,4 +76,11 @@ class DocumentsController < ApplicationController Mailer.deliver_attachments_added(attachments[:files]) if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added') redirect_to :action => 'show', :id => @document end + +private + def find_project + @project = Project.find(params[:project_id]) + rescue ActiveRecord::RecordNotFound + render_404 + end end