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 {
|
if session == nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
val := session.Values[SESS_USER]
|
val, _ := session.Values[SESS_USER].(string)
|
||||||
if val == nil {
|
return val
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return val.(string)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current session
|
// Current session
|
||||||
|
Loading…
Reference in New Issue
Block a user