From 0603c90e96de7a8ac9ac5f966c33a4acc360e10c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicklas=20Av=C3=A9n?= Date: Sun, 28 Jun 2015 16:10:02 +0000 Subject: [PATCH] return null if no valid geoemtries is found #3185 git-svn-id: http://svn.osgeo.org/postgis/trunk@13730 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/lwgeom_inout.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/postgis/lwgeom_inout.c b/postgis/lwgeom_inout.c index f371a5894..683d2cc48 100644 --- a/postgis/lwgeom_inout.c +++ b/postgis/lwgeom_inout.c @@ -584,6 +584,13 @@ Datum TWKBFromLWGEOMArray(PG_FUNCTION_ARGS) array_free_iterator(iter_geoms); array_free_iterator(iter_ids); + if(i==0) + { + elog(NOTICE, "No valid geometry - id pairs found"); + PG_FREE_IF_COPY(arr_geoms, 0); + PG_FREE_IF_COPY(arr_ids, 1); + PG_RETURN_NULL(); + } if ( is_homogeneous ) { col->type = lwtype_get_collectiontype(subtype); -- 2.40.0