From 850dc09a4f0a351b1cc23cf23d8b782ff639cdcb Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Wed, 31 Jan 2018 12:07:54 +0100 Subject: [PATCH] Going green with empty responses --- .../python/cartodb_services/cartodb_services/mapbox/geocoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/lib/python/cartodb_services/cartodb_services/mapbox/geocoder.py b/server/lib/python/cartodb_services/cartodb_services/mapbox/geocoder.py index 5be6da0..6addc81 100644 --- a/server/lib/python/cartodb_services/cartodb_services/mapbox/geocoder.py +++ b/server/lib/python/cartodb_services/cartodb_services/mapbox/geocoder.py @@ -39,7 +39,7 @@ class MapboxGeocoder(Traceable): def _parse_geocoder_response(self, response): json_response = json.loads(response) - if json_response: + if json_response and json_response[ENTRY_FEATURES]: feature = json_response[ENTRY_FEATURES][0] return self._extract_lng_lat_from_feature(feature)