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