diff --git a/main.go b/main.go index ba838bd..ee4f869 100644 --- a/main.go +++ b/main.go @@ -340,6 +340,7 @@ func getMatch(w http.ResponseWriter, r *http.Request) { if err != nil { log.Warningf("[GM] match %d not found: %+v", matchId, err) w.WriteHeader(http.StatusNotFound) + return } mResponse := &MatchResponse{ @@ -360,6 +361,8 @@ func getMatch(w http.ResponseWriter, r *http.Request) { db.Lock.RUnlock() if err != nil { log.Errorf("[GM] can't find stats for match %d: %v", tMatch.ID, err) + w.WriteHeader(http.StatusInternalServerError) + return } for _, iStats := range tStats {