Photoblog: fix cast nil session value
This commit is contained in:
parent
b8f03b87c9
commit
16fa08d2a1
@ -94,11 +94,8 @@ func (app *AuthCookie) Username(res http.ResponseWriter, req *http.Request) stri
|
||||
if session == nil {
|
||||
return ""
|
||||
}
|
||||
val := session.Values[SESS_USER]
|
||||
if val == nil {
|
||||
return ""
|
||||
}
|
||||
return val.(string)
|
||||
val, _ := session.Values[SESS_USER].(string)
|
||||
return val
|
||||
}
|
||||
|
||||
// Current session
|
||||
|
Loading…
Reference in New Issue
Block a user