mirror of
https://github.com/redmine/redmine.git
synced 2026-01-26 01:10:01 +01:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user