From 3d85dd03a20a9c16244ac63af020b6ec2bd38c9d Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Sat, 29 Dec 2018 17:43:50 +0000 Subject: [PATCH] Handle empty shipyard list e.g. at stations under repair --- plugins/eddn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index f2b68403..1859c9e5 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -213,7 +213,7 @@ class EDDN: def export_shipyard(self, data, is_beta): ships = data['lastStarport'].get('ships') or { 'shipyard_list': {}, 'unavailable_list': [] } - shipyard = sorted([ship['name'].lower() for ship in ships['shipyard_list'].values() + ships['unavailable_list']]) + shipyard = sorted([ship['name'].lower() for ship in (ships['shipyard_list'] or {}).values() + ships['unavailable_list']]) if shipyard and this.shipyard != shipyard: # Don't send empty ships list - shipyard data is only guaranteed present if user has visited the shipyard. self.send(data['commander']['name'], { '$schemaRef' : 'https://eddn.edcd.io/schemas/shipyard/2' + (is_beta and '/test' or ''),