Browse Source

avoid using rescue in its modifier form at AttachmentsController#find_container

git-svn-id: http://svn.redmine.org/redmine/trunk@19863 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.2.0
Toshi MARUYAMA 3 years ago
parent
commit
8b0c21cbf8
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      app/controllers/attachments_controller.rb

+ 6
- 1
app/controllers/attachments_controller.rb View File

@@ -218,7 +218,12 @@ class AttachmentsController < ApplicationController
end

def find_container
klass = params[:object_type].to_s.singularize.classify.constantize rescue nil
klass =
begin
params[:object_type].to_s.singularize.classify.constantize
rescue
nil
end
unless klass && klass.reflect_on_association(:attachments)
render_404
return

Loading…
Cancel
Save