From 3b046c8fc2275d0084927723a00c8f1172ff0248 Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Fri, 31 Mar 2023 15:31:54 +0200
Subject: [PATCH] fix(carto): Cannot read property 'match' of undefined

---
 src/structures/structures.controller.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/structures/structures.controller.ts b/src/structures/structures.controller.ts
index aec18cd4f..d26535088 100644
--- a/src/structures/structures.controller.ts
+++ b/src/structures/structures.controller.ts
@@ -77,7 +77,7 @@ export class StructuresController {
               ) ||
               _.deburr(cityPoint.properties.name?.toLowerCase().replace(/\-/g, ' ')) ===
                 _.deburr(city).toLowerCase().replace(/\-/g, ' ')) &&
-            cityPoint.properties.postcode.match(depRegex)
+            cityPoint.properties.postcode?.match(depRegex)
         )
       )
       .then((data) => data.map((filteredCityPoint) => filteredCityPoint.geometry.coordinates));
-- 
GitLab