return if no matches found /2

This commit is contained in:
2021-10-17 18:23:27 +02:00
parent 3a080bc36f
commit 29e6dcd454

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 {
if err != nil || len(tMatches) == 0 {
log.Debugf("[GP] No matches found for player %s", id)
err := utils.SendJSON(response, w)
if err != nil {