From 468cda4d26b71e321249987f44725bfa1c2ae474 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Sun, 17 Oct 2021 18:43:15 +0200 Subject: [PATCH] return if no matches found /3 --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 2350263..80be0e4 100644 --- a/main.go +++ b/main.go @@ -166,7 +166,7 @@ func getPlayer(w http.ResponseWriter, r *http.Request) { db.Lock.RLock() tMatches, err := tPlayer.QueryMatches().Order(ent.Desc(match.FieldDate)).Limit(10).All(context.Background()) db.Lock.RUnlock() - if err != nil || len(tMatches) == 0 { + if err != nil || len(tMatches) == 0 || tMatches == nil { log.Debugf("[GP] No matches found for player %s", id) err := utils.SendJSON(response, w) if err != nil {