[GRASS-SVN] r69268 - grass/branches/releasebranch_7_2/vector/v.overlay

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 27 04:28:43 PDT 2016


Author: martinl
Date: 2016-08-27 04:28:43 -0700 (Sat, 27 Aug 2016)
New Revision: 69268

Modified:
   grass/branches/releasebranch_7_2/vector/v.overlay/main.c
Log:
 v.overlay: avoid fatal error (layer index invalid) when output map is empty and olayer=0,1,0 (merge r68764 from trunk)

Modified: grass/branches/releasebranch_7_2/vector/v.overlay/main.c
===================================================================
--- grass/branches/releasebranch_7_2/vector/v.overlay/main.c	2016-08-27 10:56:36 UTC (rev 69267)
+++ grass/branches/releasebranch_7_2/vector/v.overlay/main.c	2016-08-27 11:28:43 UTC (rev 69268)
@@ -11,7 +11,7 @@
  *               OGR support by Martin Landa <landa.martin gmail.com>
  *               Markus Metz
  * PURPOSE:      
- * COPYRIGHT:    (C) 2003-2014 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2003-2016 by the GRASS Development Team
  *
  *               This program is free software under the GNU General
  *               Public License (>=v2). Read the file COPYING that
@@ -645,9 +645,11 @@
     struct ilist *list;
     int findex;
     
+    findex = Vect_cidx_get_field_index(Out, outfield);
+    if (findex < 0) 
+        return;
+
     list = Vect_new_list();
-    findex = Vect_cidx_get_field_index(Out, outfield);
-    
     Vect_cidx_get_unique_cats_by_index(Out, findex, list);
     Vect_copy_table_by_cats(In, Out, infield, outfield, NULL,
                             GV_1TABLE, list->value, list->n_values);



More information about the grass-commit mailing list