diff --git a/client/src/pages/map/popups/Polygon.tsx b/client/src/pages/map/popups/Polygon.tsx index 521ee0a7..c21bddcc 100644 --- a/client/src/pages/map/popups/Polygon.tsx +++ b/client/src/pages/map/popups/Polygon.tsx @@ -318,6 +318,11 @@ export function PolygonPopup({ c.length < 2) + : feature.geometry.coordinates.length < 2 + } onClick={() => { useImportExport.setState({ feature: getFeatureCutouts(feature), diff --git a/client/src/services/geoUtils.ts b/client/src/services/geoUtils.ts index c1a86e43..32ddb1a3 100644 --- a/client/src/services/geoUtils.ts +++ b/client/src/services/geoUtils.ts @@ -134,6 +134,9 @@ export function getFeatureCutouts( type: 'MultiPolygon', coordinates: polygons.map((p) => p.coordinates), } - : polygons[0], + : polygons[0] || { + type: '', + coordinates: [], + }, } }