Adding a test for undefined addresses
This commit is contained in:
1 parent
229bc14f72
commit
ba14181bdd
1 file changed
+2
@@ -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) {
|
||||||
|
|||||||
Reference in new issue
Block a user