Skip to content

Commit

Permalink
Merge pull request #192 from cwendt94/FindingMatchupKeyError#189
Browse files Browse the repository at this point in the history
Handle No Home Team in Matchup
  • Loading branch information
cwendt94 authored Mar 26, 2021
2 parents ae7945c + c931b16 commit a44aac4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion espn_api/basketball/league.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _map_matchup_ids(self, schedule):
self.matchup_ids = {}
for match in schedule:
matchup_period = match.get('matchupPeriodId')
scoring_periods = match['home'].get('pointsByScoringPeriod', {}).keys()
scoring_periods = match.get('home', {}).get('pointsByScoringPeriod', {}).keys()
if len(scoring_periods) > 0:
if matchup_period not in self.matchup_ids:
self.matchup_ids[matchup_period] = sorted(scoring_periods)
Expand Down

0 comments on commit a44aac4

Please sign in to comment.