Skip to content

Commit

Permalink
player might not have stats field
Browse files Browse the repository at this point in the history
  • Loading branch information
cwendt94 committed Sep 24, 2020
1 parent 35de3a5 commit da810ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion espn_api/football/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, data):
self.injuryStatus = player.get('injuryStatus', self.injuryStatus)
self.injured = player.get('injured', False)

player_stats = player.get('stats')
player_stats = player.get('stats', [])
for stats in player_stats:
stats_breakdown = stats.get('appliedStats') if stats.get('appliedStats') else stats.get('stats', {})
breakdown = {PLAYER_STATS_MAP.get(int(k), k):v for (k,v) in stats_breakdown.items()}
Expand Down

0 comments on commit da810ac

Please sign in to comment.