Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle missing value
  • Loading branch information
StoicLoofah committed Sep 29, 2020
commit c9338cf6125ad4b545287a06ccaecd9998ef8065
6 changes: 5 additions & 1 deletion sc2reader/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ def __init__(self, header, attr_id, player, value):
self.value = None
else:
self.name, lookup = LOBBY_PROPERTIES[self.id]
self.value = lookup[value.strip("\x00 ")[::-1]]
try:
self.value = lookup[value.strip("\x00 ")[::-1]]
except KeyError:
self.logger.info("Missing attribute value: {0}".format(value))
self.value = None

def __repr__(self):
return str(self)
Expand Down