Adding a test for undefined addresses

This commit is contained in:
Eric van der Vlist 2023-03-10 23:36:45 +01:00
parent 229bc14f72
commit ba14181bdd
1 changed files with 3 additions and 1 deletions

View File

@ -36,6 +36,8 @@ export const getVillageOrTown = (address: any) => {
'locality', 'locality',
]; ];
if (!address || !address.address) return '';
for (let synonym of citySynonyms) { for (let synonym of citySynonyms) {
// console.log({ caller: 'getVillageOrTown', address, synonym }); // console.log({ caller: 'getVillageOrTown', address, synonym });
if (synonym in address?.address) { if (synonym in address?.address) {