diff --git a/app/Validators/Extensions/Polygons/WithinCountry.php b/app/Validators/Extensions/Polygons/WithinCountry.php index 98571c3ba..4e6e71767 100644 --- a/app/Validators/Extensions/Polygons/WithinCountry.php +++ b/app/Validators/Extensions/Polygons/WithinCountry.php @@ -33,6 +33,9 @@ public static function getIntersectionData(string $polygonUuid): array if ($geometry === null) { return ['valid' => false, 'status' => 404, 'error' => 'Geometry not found']; } + if ($geometry->db_geometry->area == 0) { + return ['valid' => false, 'status' => 500, 'error' => 'Geometry invalid']; + } $sitePolygonData = SitePolygon::forPolygonGeometry($polygonUuid)->select('site_id')->first(); if ($sitePolygonData == null) {