summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-07-08 17:30:12 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-07-08 17:30:12 +0000
commitddcdac3017a606263843b82c668c3ae087edfa0c (patch)
tree1f47dc2ba9587a7cab1fc093983d7f77a90f78f3 /app/controllers
parent8b0c21cbf87f292557cc2949fa9c1027398e79bb (diff)
downloadredmine-ddcdac3017a606263843b82c668c3ae087edfa0c.tar.gz
redmine-ddcdac3017a606263843b82c668c3ae087edfa0c.zip
avoid using rescue in its modifier form at ImportsController#import_type
git-svn-id: http://svn.redmine.org/redmine/trunk@19864 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/imports_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb
index 60376f4f0..ed42342ce 100644
--- a/app/controllers/imports_controller.rb
+++ b/app/controllers/imports_controller.rb
@@ -157,7 +157,12 @@ class ImportsController < ApplicationController
if @import
@import.class
else
- type = Object.const_get(params[:type]) rescue nil
+ type =
+ begin
+ Object.const_get(params[:type])
+ rescue
+ nil
+ end
type && type < Import ? type : nil
end
end