diff --git a/plugins/eddn.py b/plugins/eddn.py index 62ebbaa5..e03cb3cb 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -270,14 +270,22 @@ Msg:\n{msg}''') :param data: dict containing the outfitting data :param is_beta: whether or not we're currently in beta mode """ - modules: Dict[str, Any] = data['lastStarport'].get('modules') or {} + modules: Dict[str, Any] = data['lastStarport'].get('modules') + if modules is None: + logger.debug('modules was None') + modules = {} + + ships: Dict[str, Any] = data['lastStarport'].get('ships') + if ships is None: + logger.debug('ships was None') + ships = {'shipyard_list': {}, 'unavailable_list': []} # Horizons flag - will hit at least Int_PlanetApproachSuite other than at engineer bases ("Colony"), # prison or rescue Megaships, or under Pirate Attack etc horizons: bool = is_horizons( data['lastStarport'].get('economies', {}), modules, - data['lastStarport'].get('ships', {'shipyard_list': {}, 'unavailable_list': []}) + ships ) to_search: Iterator[Mapping[str, Any]] = filter( @@ -313,10 +321,19 @@ Msg:\n{msg}''') :param data: dict containing the shipyard data :param is_beta: whether or not we are in beta mode """ - ships: Dict[str, Any] = data['lastStarport'].get('ships', {'shipyard_list': {}, 'unavailable_list': []}) + modules: Dict[str, Any] = data['lastStarport'].get('modules') + if modules is None: + logger.debug('modules was None') + modules = {} + + ships: Dict[str, Any] = data['lastStarport'].get('ships') + if ships is None: + logger.debug('ships was None') + ships = {'shipyard_list': {}, 'unavailable_list': []} + horizons: bool = is_horizons( data['lastStarport'].get('economies', {}), - data['lastStarport'].get('modules', {}), + modules, ships )