From 0fa1599f953a413a39a54e9ab8112215862bcc1e Mon Sep 17 00:00:00 2001 From: JaffaKetchup Date: Wed, 14 Feb 2024 13:07:55 +0000 Subject: [PATCH] Fixed bug where undefined/null `Polygon.hitValue` threw error --- lib/src/layer/polygon_layer/painter.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/layer/polygon_layer/painter.dart b/lib/src/layer/polygon_layer/painter.dart index 0da257746..a0b6eef93 100644 --- a/lib/src/layer/polygon_layer/painter.dart +++ b/lib/src/layer/polygon_layer/painter.dart @@ -92,7 +92,7 @@ class _PolygonPainter extends CustomPainter { // Second check handles case where polygon outline intersects a hole, // ensuring that the hit matches with the visual representation if ((isInPolygon && !isInHole) || (!isInPolygon && isInHole)) { - _hits.add(polygon.hitValue!); + if (polygon.hitValue != null) _hits.add(polygon.hitValue!); hasHit = true; } }