Skip to content

Commit

Permalink
Handle No Home Team in Matchup
Browse files Browse the repository at this point in the history
  • Loading branch information
cwendt94 committed Mar 26, 2021
1 parent ae7945c commit c931b16
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 c931b16

Please sign in to comment.