Skip to content

Commit

Permalink
fix: prevent null exception when undefined/null Polygon.hitValue (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JaffaKetchup authored Feb 14, 2024
1 parent 45cd08c commit 562bff1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/layer/polygon_layer/painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class _PolygonPainter<R extends Object> 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;
}
}
Expand Down

0 comments on commit 562bff1

Please sign in to comment.