diff --git a/src/lib/osm.ts b/src/lib/osm.ts index f271a35..69cab71 100644 --- a/src/lib/osm.ts +++ b/src/lib/osm.ts @@ -36,8 +36,10 @@ export const getVillageOrTown = (address: any) => { 'locality', ]; + if (!address || !address.address) return ''; + for (let synonym of citySynonyms) { - // console.log({ caller: 'getVillageOrTown', address, synonym }); + // console.log({ caller: 'getVillageOrTown', address, synonym }); if (synonym in address?.address) { return address?.address[synonym]; }