Sometimes the address->country field is missing

This commit is contained in:
Edward Betts 2022-04-17 17:06:46 +01:00
parent 82b0405ab7
commit a81cedaae0

View file

@ -83,8 +83,8 @@ def get_hit_name(hit):
if len(address) == 1: if len(address) == 1:
return n1 return n1
country = address.pop("country") country = address.pop("country", None)
country_code = address.pop("country_code") country_code = address.pop("country_code", None)
if country_code: if country_code:
country_code == country_code.lower() country_code == country_code.lower()