1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

Workaround for inconsistent ships data

This commit is contained in:
Jonathan Harris 2017-05-15 15:21:27 +01:00
parent 0cb2fa80f0
commit 4fa8ace8f0

View File

@ -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'):