[fix] checking for dictionary key

This commit is contained in:
Al
2016-10-19 13:34:13 -04:00
parent c2b73307de
commit 61078eded9

View File

@@ -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: