]> git.openstreetmap.org Git - rails.git/commitdiff
Fix object_id warning
authorTom Hughes <tom@compton.nu>
Mon, 7 Nov 2011 10:56:05 +0000 (10:56 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 14 Nov 2011 09:42:58 +0000 (09:42 +0000)
app/controllers/application_controller.rb

index ec2f381fc8b971448853385692c1b339c3ff3b04..d58bc8922146b32e48144e18a274ab038a6b37be 100644 (file)
@@ -35,8 +35,9 @@ class ApplicationController < ActionController::Base
         end
       end
     elsif session[:token]
-      @user = User.authenticate(:token => session[:token])
-      session[:user] = @user.id
+      if @user = User.authenticate(:token => session[:token])
+        session[:user] = @user.id
+      end
     end
   rescue Exception => ex
     logger.info("Exception authorizing user: #{ex.to_s}")