diff --git a/dota.py b/dota.py index 479389d..73b0b77 100644 --- a/dota.py +++ b/dota.py @@ -124,7 +124,12 @@ class Friend(BaseModel): if limit > 10: limit = 10 for friend in friends: - matches.extend(friend.serialize_recent_matches(limit=limit)) + matches_ = friend.serialize_recent_matches(limit=limit) + if not matches_: + continue + matches.extend(matches_) + if not matches: + return None # sort matches by start_time from latest to oldest matches.sort(key=lambda x: x['start_time'], reverse=True) name = friends[0].name