Skip to content

Commit 77fa358

Browse files
authored
Set defaults when parsing editor replays
Fixes #103
1 parent 9d97aef commit 77fa358

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sc2reader/resources.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ def load_attribute_events(self):
371371
self.attributes[attr.player][attr.name] = attr.value
372372

373373
# Populate replay with attributes
374-
self.speed = self.attributes[16]["Game Speed"]
375-
self.category = self.attributes[16]["Game Mode"]
376-
self.type = self.game_type = self.attributes[16]["Teams"]
374+
self.speed = self.attributes[16].get("Game Speed", 1.0)
375+
self.category = self.attributes[16].get("Game Mode", "")
376+
self.type = self.game_type = self.attributes[16].get("Teams", "")
377377
self.is_ladder = self.category == "Ladder"
378378
self.is_private = self.category == "Private"
379379

0 commit comments

Comments
 (0)