mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-13 05:10:59 +00:00
Fix a bug when user was deleted
This commit is contained in:
parent
bfe19eb5e9
commit
1abc42851a
1 changed files with 6 additions and 1 deletions
|
@ -13,7 +13,12 @@ class ApplicationController < ActionController::Base
|
|||
respond_to :html, :js
|
||||
|
||||
def cuser
|
||||
@cuser ||= User.find(session[:user]) if session[:user]
|
||||
begin
|
||||
@cuser ||= User.find(session[:user])
|
||||
rescue
|
||||
session[:user] = nil
|
||||
@cuser = nil
|
||||
end
|
||||
end
|
||||
|
||||
def return_here
|
||||
|
|
Loading…
Reference in a new issue