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:
parent
0cb2fa80f0
commit
4fa8ace8f0
2
stats.py
2
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'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user