From 14abffe79c73d14899566341b9d04ef125496168 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 22 Oct 2021 10:01:46 +0100 Subject: [PATCH] Avoid crash when searching for USA --- matcher/nominatim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matcher/nominatim.py b/matcher/nominatim.py index 9956400..137a05d 100644 --- a/matcher/nominatim.py +++ b/matcher/nominatim.py @@ -88,7 +88,7 @@ def get_hit_name(hit): if country_code: country_code == country_code.lower() - if country_code == "us": + if country_code == "us" and "state" in address: state = address["state"] return f"{n1}, {state}, USA"