diff --git a/stats.py b/stats.py index 1bf23bb4..19f7e4d5 100644 --- a/stats.py +++ b/stats.py @@ -149,7 +149,7 @@ def ships(data): ships = companion.listify(data.get('ships')) current = data['commander'].get('currentShipId') - if isinstance(current, int) and ships[current]: + if isinstance(current, int) and current < len(ships) and ships[current]: ships.insert(0, ships.pop(current)) # Put current ship first if not data['commander'].get('docked'):