return if no matches found /3

This commit is contained in:
2021-10-17 18:43:15 +02:00
parent 29e6dcd454
commit 468cda4d26

View File

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