Skip to content

Commit

Permalink
Check for existence of game_date before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
heshammourad committed Oct 13, 2024
1 parent 8e2e30b commit e28a956
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions messages/scoreboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def get(league):
home_score = matchup.home_score
scores = [utils.format_number(score, target_length=3, decimal_places=2)
for score in [away_score, home_score]]
to_play = [sum(1 for player in lineup if utils.is_starter(player) and player.game_date > now)
for lineup in [matchup.away_lineup, matchup.home_lineup]]
to_play = [sum(1 for player in lineup if utils.is_starter(player) and hasattr(player, 'game_date')
and player.game_date > now) for lineup in [matchup.away_lineup, matchup.home_lineup]]

scoreboard.append({'type': 'divider'})
scoreboard.append(utils.get_context_from_arr(get_breakdown(to_play[0], matchup.away_projected)))
Expand Down

0 comments on commit e28a956

Please sign in to comment.