mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
Catch where station modules from CAPI is an empty list.
Out of paranoia we're also checking if it's a non-empty list and logging that as an error if encountered. It should be a dictionary!
This commit is contained in:
parent
42c826f04b
commit
81f71c88ff
@ -271,8 +271,13 @@ Msg:\n{msg}''')
|
||||
:param is_beta: whether or not we're currently in beta mode
|
||||
"""
|
||||
modules: Dict[str, Any] = data['lastStarport'].get('modules')
|
||||
if modules is None:
|
||||
logger.debug('modules was None')
|
||||
if modules is None or isinstance(modules, list):
|
||||
if modules is None:
|
||||
logger.debug('modules was None')
|
||||
elif modules == []:
|
||||
logger.debug('modules is empty list')
|
||||
else:
|
||||
logger.error(f'modules is non-empty list: {modules!r}')
|
||||
modules = {}
|
||||
|
||||
ships: Dict[str, Any] = data['lastStarport'].get('ships')
|
||||
@ -322,8 +327,13 @@ Msg:\n{msg}''')
|
||||
:param is_beta: whether or not we are in beta mode
|
||||
"""
|
||||
modules: Dict[str, Any] = data['lastStarport'].get('modules')
|
||||
if modules is None:
|
||||
logger.debug('modules was None')
|
||||
if modules is None or isinstance(modules, list):
|
||||
if modules is None:
|
||||
logger.debug('modules was None')
|
||||
elif modules == []:
|
||||
logger.debug('modules is empty list')
|
||||
else:
|
||||
logger.error(f'modules is non-empty list: {modules!r}')
|
||||
modules = {}
|
||||
|
||||
ships: Dict[str, Any] = data['lastStarport'].get('ships')
|
||||
|
Loading…
x
Reference in New Issue
Block a user