[fix] null check

This commit is contained in:
Al
2016-08-06 20:39:28 -04:00
parent 3e34012e69
commit e68fee7c68

View File

@@ -346,6 +346,8 @@ class OSMAddressFormatter(object):
and a slightly more sophisticated phrase generator than what we employ for numeric components
like apartment numbers.
'''
if self.metro_stations_index is None:
return
nearest_metro = self.metro_stations_index.nearest_point(latitude, longitude)
if nearest_metro:
props, lat, lon, distance = nearest_metro