Enha: avoid nil panics

This commit is contained in:
Grail Finder
2025-07-12 21:02:10 +03:00
parent a934d07be3
commit 757586ea22
4 changed files with 38 additions and 27 deletions

View File

@ -75,8 +75,9 @@ func HandleExit(w http.ResponseWriter, r *http.Request) {
return
}
fi, err := getFullInfoByCtx(r.Context())
if err != nil {
abortWithError(w, err.Error())
if err != nil || fi == nil {
log.Error("failed to fetch fi", "error", err)
http.Redirect(w, r, "/", 302)
return
}
if fi.Room.IsRunning {