[fix] checking for dictionary key
This commit is contained in:
@@ -546,7 +546,7 @@ class OSMAddressFormatter(object):
|
|||||||
for i, c in enumerate(osm_components):
|
for i, c in enumerate(osm_components):
|
||||||
c_name = osm_address_components.component_from_properties(country, c, containing=containing_ids[i + 1:])
|
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
|
same_name_components[i] = c_name
|
||||||
|
|
||||||
if first_valid_admin_center is None:
|
if first_valid_admin_center is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user