From: Sandro Santilli Date: Thu, 30 Dec 2004 13:35:50 +0000 (+0000) Subject: Handled NULL returns from getCentroid making it an EMPTY GEOM X-Git-Tag: pgis_1_0_0RC1~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c646297a2f5d870ff0ac7a8f453079985139dfd;p=postgis Handled NULL returns from getCentroid making it an EMPTY GEOM git-svn-id: http://svn.osgeo.org/postgis/trunk@1193 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwgeom_geos_wrapper.cpp b/lwgeom/lwgeom_geos_wrapper.cpp index 2745bc5fd..355bfe561 100644 --- a/lwgeom/lwgeom_geos_wrapper.cpp +++ b/lwgeom/lwgeom_geos_wrapper.cpp @@ -1587,7 +1587,11 @@ const Geometry *GEOSGetInteriorRingN(Geometry *g1,int n) Geometry *GEOSGetCentroid(Geometry *g) { try{ - return g->getCentroid(); + Geometry *ret = g->getCentroid(); + if ( ret == NULL ) { + ret = geomFactory->createGeometryCollection(); + } + return ret; } catch (GEOSException *ge) { @@ -1595,7 +1599,6 @@ Geometry *GEOSGetCentroid(Geometry *g) delete ge; return NULL; } - catch(...) { return NULL;