diff --git a/photoblog/admin/admin.go b/photoblog/admin/admin.go index f4e331d..6eeb768 100644 --- a/photoblog/admin/admin.go +++ b/photoblog/admin/admin.go @@ -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