Fixed nil pointer derefence due accessing account page if cookie not set
This commit is contained in:
@@ -19,9 +19,9 @@ func HandleAccountPage() http.Handler {
|
|||||||
return http.HandlerFunc(
|
return http.HandlerFunc(
|
||||||
func(w http.ResponseWriter, r *http.Request) {
|
func(w http.ResponseWriter, r *http.Request) {
|
||||||
cookie, err := r.Cookie("subpage")
|
cookie, err := r.Cookie("subpage")
|
||||||
subpage := cookie.Value
|
subpage := "General"
|
||||||
if err != nil {
|
if err == nil {
|
||||||
subpage = "General"
|
subpage = cookie.Value
|
||||||
}
|
}
|
||||||
page.Account(subpage).Render(r.Context(), w)
|
page.Account(subpage).Render(r.Context(), w)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user