Adding a test for undefined addresses
This commit is contained in:
parent
229bc14f72
commit
ba14181bdd
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue