From a81cedaae0db131d3766229528f2f42478dc37f3 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 17 Apr 2022 17:06:46 +0100 Subject: [PATCH] Sometimes the address->country field is missing --- matcher/nominatim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matcher/nominatim.py b/matcher/nominatim.py index 5e70793..cfee85f 100644 --- a/matcher/nominatim.py +++ b/matcher/nominatim.py @@ -83,8 +83,8 @@ def get_hit_name(hit): if len(address) == 1: return n1 - country = address.pop("country") - country_code = address.pop("country_code") + country = address.pop("country", None) + country_code = address.pop("country_code", None) if country_code: country_code == country_code.lower()