]> source.dussan.org Git - redmine.git/commitdiff
avoid using rescue in its modifier form at ImportsController#import_type
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 8 Jul 2020 17:30:12 +0000 (17:30 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 8 Jul 2020 17:30:12 +0000 (17:30 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19864 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/imports_controller.rb

index 60376f4f0403fd63ea3b2f04b66b06897eec8839..ed42342ce1d2dba3ded63868a8c2ce46e4d3716e 100644 (file)
@@ -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