]> granicus.if.org Git - postgis/commitdiff
return null if no valid geoemtries is found #3185
authorNicklas Avén <nicklas.aven@jordogskog.no>
Sun, 28 Jun 2015 16:10:02 +0000 (16:10 +0000)
committerNicklas Avén <nicklas.aven@jordogskog.no>
Sun, 28 Jun 2015 16:10:02 +0000 (16:10 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13730 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_inout.c

index f371a58945b51b70c4115b83c6fd0f36ebcdc3b7..683d2cc48caf3f3c13044efb820bc67eab4c5147 100644 (file)
@@ -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);