diff --git a/sc2reader/engine/plugins/context.py b/sc2reader/engine/plugins/context.py index 5a8fb34..5206db2 100644 --- a/sc2reader/engine/plugins/context.py +++ b/sc2reader/engine/plugins/context.py @@ -63,7 +63,9 @@ def handleCommandEvent(self, event, replay): self.logger.error("Other unit {0} not found".format(event.other_unit_id)) def handleTargetUnitCommandEvent(self, event, replay): - self.last_target_ability_event[event.player.pid] = event + if event.player: + self.last_target_ability_event[event.player.pid] = event + if not replay.datapack: return