From 61078eded98afd642f827f5bb24cc6165c618998 Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 19 Oct 2016 13:34:13 -0400 Subject: [PATCH] [fix] checking for dictionary key --- scripts/geodata/osm/formatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/geodata/osm/formatter.py b/scripts/geodata/osm/formatter.py index 40d04214..6fe8202e 100644 --- a/scripts/geodata/osm/formatter.py +++ b/scripts/geodata/osm/formatter.py @@ -546,7 +546,7 @@ class OSMAddressFormatter(object): for i, c in enumerate(osm_components): c_name = osm_address_components.component_from_properties(country, c, containing=containing_ids[i + 1:]) - if c.get('name', '').lower() == tags['name'].lower(): + if 'name' in tags and c.get('name', '').lower() == tags['name'].lower(): same_name_components[i] = c_name if first_valid_admin_center is None: