Fix: on login add player once

This commit is contained in:
Grail Finder
2025-07-11 09:03:18 +03:00
parent d056c4a07e
commit 37fe76456e
7 changed files with 30 additions and 34 deletions

View File

@ -128,8 +128,10 @@ func HandleStats(w http.ResponseWriter, r *http.Request) {
return
}
fi, err := getFullInfoByCtx(r.Context())
if err != nil {
if err != nil || fi == nil {
log.Error("failed to fetch fi", "error", err)
http.Redirect(w, r, "/", 302)
return
}
// there must be a better way
if fi != nil && fi.Room != nil && fi.Room.ID != "" && fi.State != nil {