diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-08-03 14:18:22 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-08-03 14:18:22 +0100 |
commit | cd73e401622d31a189d8cf3b38e9cbe46ca73e96 (patch) | |
tree | e5efd1f1a4c650ec4333a59d54d015342e24ddbf /app/controllers/application_controller.rb | |
parent | f5e5b605bac9e80f7556b666643eec25b6987545 (diff) |
Fail silently if there's no user matching one referenced in the current session. Fixes #105
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5f18be2e5..ba1cf4900 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -221,7 +221,11 @@ class ApplicationController < ActionController::Base if session[:user_id].nil? return nil else - return User.find(session[:user_id]) + begin + return User.find(session[:user_id]) + rescue ActiveRecord::RecordNotFound + return nil + end end end |