return after writing header

This commit is contained in:
2021-10-08 21:04:09 +02:00
parent cce5c5d072
commit d5e9246112

View File

@@ -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 {