diff --git a/hub/persistence/repositories/city.py b/hub/persistence/repositories/city.py index a1459c96..20f36882 100644 --- a/hub/persistence/repositories/city.py +++ b/hub/persistence/repositories/city.py @@ -60,8 +60,11 @@ class City(Repository): for building in city.buildings: object_usage = '' for internal_zone in building.internal_zones: - for usage in internal_zone.usages: - object_usage = f'{object_usage}{usage.name}_{usage.percentage} ' + if internal_zone is None or internal_zone.usages is None: + object_usage = 'Unknown' + else: + for usage in internal_zone.usages: + object_usage = f'{object_usage}{usage.name}_{usage.percentage} ' object_usage = object_usage.rstrip() db_city_object = CityObject(db_city.id, building.name,