diff --git a/sc2reader/engine/plugins/context.py b/sc2reader/engine/plugins/context.py index dd846634..74e7c548 100644 --- a/sc2reader/engine/plugins/context.py +++ b/sc2reader/engine/plugins/context.py @@ -250,7 +250,7 @@ def handleUnitOwnerChangeEvent(self, event, replay): ) ) - if event.unit_upkeeper: + if event.unit_upkeeper and event.unit: if event.unit.owner: event.unit.owner.units.remove(event.unit) event.unit.owner = event.unit_upkeeper