Skip to content

Commit 9c02c39

Browse files
committed
Allow for the possibility of unknown regions.
1 parent 1ac5e27 commit 9c02c39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sc2reader/resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def load_players(self):
393393
if 'replay.initData' in self.raw_data and self.gateway:
394394
player.gateway = self.gateway
395395
if player.is_human and player.subregion:
396-
player.region = REGIONS[self.gateway][player.subregion]
396+
player.region = REGIONS[self.gateway].get(player.subregion, 'Unknown')
397397
default_region = player.region
398398

399399
# Conversion instructions to the new color object:
@@ -956,7 +956,7 @@ def load_players(self):
956956
if not player.is_ai:
957957
player.gateway = self.gateway
958958
player.subregion = struct[0][1][0][2]
959-
player.region = REGIONS[player.gateway][player.subregion]
959+
player.region = REGIONS[player.gateway].get(player.subregion, 'Unknown')
960960
player.bnetid = struct[0][1][0][3]
961961
player.unknown1 = struct[0][1][0]
962962
player.unknown2 = struct[0][1][1]

0 commit comments

Comments
 (0)