blob: cb298718bec5e764ce9fcfd32058789952e5211a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
--- a/src/mjolnir/adminbuilder.cc
+++ b/src/mjolnir/adminbuilder.cc
@@ -133,7 +133,8 @@
for (const auto& inner : polygon.inners()) {
inner_rings.push_back(geos_helper_t::from_striped_container(inner));
}
- auto* geos_poly = GEOSGeom_createPolygon(outer_ring, &inner_rings.front(), inner_rings.size());
+ auto* geos_poly = GEOSGeom_createPolygon(outer_ring,
+ inner_rings.empty() ? nullptr : &inner_rings.front(), inner_rings.size());
auto* buffered = GEOSBuffer(geos_poly, 0, 8);
GEOSNormalize(buffered);
auto geom_type = GEOSGeomTypeId(buffered);
|