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

app/controllers/application_controller.rb

index 6ccf75546a083a1ce79ec57a8a3f5b3b8dcc4b18..fca9ebc90265cacd2d4545722e25a9fd5a4664e4 100644 (file)
@@ -106,7 +106,12 @@ class ApplicationController < ActionController::Base
     unless api_request?
       if session[:user_id]
         # existing session
-        user = (User.active.find(session[:user_id]) rescue nil)
+        user =
+          begin
+            User.active.find(session[:user_id])
+          rescue
+            nil
+          end
       elsif autologin_user = try_to_autologin
         user = autologin_user
       elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth?