Photoblog: fix cast nil session value

This commit is contained in:
Meutel 2017-07-29 19:30:32 +02:00
parent b8f03b87c9
commit 16fa08d2a1

View File

@ -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