From fa5f6beb12b13430fb47447c26d6f37957277a20 Mon Sep 17 00:00:00 2001 From: Dean Date: Wed, 27 Dec 2023 11:34:19 -0500 Subject: [PATCH] edge case "None" owners fix --- espn_api/base_league.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/espn_api/base_league.py b/espn_api/base_league.py index ea20e10e..f1941f6e 100644 --- a/espn_api/base_league.py +++ b/espn_api/base_league.py @@ -59,7 +59,7 @@ def _fetch_teams(self, data, TeamClass, pro_schedule = None): for team in teams: roster = team_roster[team['id']] - owners = [member for member in members if member.get('id') == team.get('owners', [''])[0]] + owners = [member for member in members if member.get('id') == (team.get('owners') or [''])[0]] self.teams.append(TeamClass(team, roster=roster, schedule=schedule, year=seasonId, owners=owners, pro_schedule=pro_schedule)) # sort by team ID @@ -101,4 +101,4 @@ def _get_all_pro_schedule(self): def standings(self) -> List: standings = sorted(self.teams, key=lambda x: x.final_standing if x.final_standing != 0 else x.standing, reverse=False) - return standings \ No newline at end of file + return standings