From 9994bed47e034aef99497ca3abb95f996cbbdf15 Mon Sep 17 00:00:00 2001 From: Haelnorr Date: Sun, 16 Feb 2025 13:54:44 +1100 Subject: [PATCH] Fixed nil pointer derefence due accessing account page if cookie not set --- handlers/account.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/handlers/account.go b/handlers/account.go index be79910..365a283 100644 --- a/handlers/account.go +++ b/handlers/account.go @@ -19,9 +19,9 @@ func HandleAccountPage() http.Handler { return http.HandlerFunc( func(w http.ResponseWriter, r *http.Request) { cookie, err := r.Cookie("subpage") - subpage := cookie.Value - if err != nil { - subpage = "General" + subpage := "General" + if err == nil { + subpage = cookie.Value } page.Account(subpage).Render(r.Context(), w) },