From ddcdac3017a606263843b82c668c3ae087edfa0c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 8 Jul 2020 17:30:12 +0000 Subject: [PATCH] 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 --- app/controllers/imports_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.39.5