From 993415785b1059d0b924b016d1900e19b2a38ad5 Mon Sep 17 00:00:00 2001 From: Christian Wendt Date: Mon, 4 Apr 2022 08:58:18 -0700 Subject: [PATCH] Update player.py --- espn_api/hockey/player.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/espn_api/hockey/player.py b/espn_api/hockey/player.py index 5082acb6..4941b7e6 100644 --- a/espn_api/hockey/player.py +++ b/espn_api/hockey/player.py @@ -7,9 +7,9 @@ class Player(object): def __init__(self, data): self.name = json_parsing(data, 'fullName') self.playerId = json_parsing(data, 'id') - self.position = POSITION_MAP[json_parsing(data, 'defaultPositionId')] + self.position = POSITION_MAP.get(json_parsing(data, 'defaultPositionId'), '') self.lineupSlot = POSITION_MAP.get(data.get('lineupSlotId'), '') - self.eligibleSlots = [POSITION_MAP[pos] for pos in json_parsing(data, 'eligibleSlots')] + self.eligibleSlots = [POSITION_MAP.get(pos, '') for pos in json_parsing(data, 'eligibleSlots')] self.acquisitionType = json_parsing(data, 'acquisitionType') self.proTeam = PRO_TEAM_MAP.get(json_parsing(data, 'proTeamId'), 'Unknown Team') self.injuryStatus = json_parsing(data, 'injuryStatus')