From: Toshi MARUYAMA Date: Wed, 8 Jul 2020 17:30:12 +0000 (+0000) Subject: avoid using rescue in its modifier form at ImportsController#import_type X-Git-Tag: 4.2.0~933 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ddcdac3017a606263843b82c668c3ae087edfa0c;p=redmine.git 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 --- 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