Skip to content

Commit

Permalink
Merge pull request #313 from alexindaco/bugfix/hockey_schedule_home_m…
Browse files Browse the repository at this point in the history
…issing

add default for hockey league data['schedule']['home']
  • Loading branch information
cwendt94 committed Jan 20, 2022
2 parents 5fdf2d2 + b0f9862 commit e8fe651
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion espn_api/hockey/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 e8fe651

Please sign in to comment.