diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp index 69ea4f510..1611118b1 100644 --- a/capi/geos_ts_c.cpp +++ b/capi/geos_ts_c.cpp @@ -1184,7 +1184,7 @@ extern "C" { { return execute(extHandle, [&]() { BufferParameters bp; - //-- use default cap style ROUND + //-- use default cap style ROUND bp.setQuadrantSegments(quadsegs); if(joinStyle > BufferParameters::JOIN_BEVEL) { @@ -2069,10 +2069,11 @@ extern "C" { GeometryCollection *col = dynamic_cast(collection); if (!col) { handle->ERROR_MESSAGE("Parameter collection of GEOSGeom_releaseCollection_r must not be a collection"); + } else { + *ngeoms = static_cast(col->getNumGeometries()); } // Early exit on empty/null input - *ngeoms = static_cast(col->getNumGeometries()); if (!col || *ngeoms == 0) { return static_cast(nullptr); }