Browse Source

vlib: don't build when no OGR layer available

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47855 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 năm trước cách đây
mục cha
commit
6ba15c3c3b
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      lib/vector/Vlib/build_ogr.c

+ 5 - 0
lib/vector/Vlib/build_ogr.c

@@ -360,6 +360,11 @@ int Vect_build_ogr(struct Map_info *Map, int build)
     Map->fInfo.ogr.offset_num = 0;
     Map->fInfo.ogr.offset_alloc = 0;
     
+    if (!Map->fInfo.ogr.layer) {
+	G_warning(_("Empty OGR layer, nothing to build"));
+	return 0;
+    }
+    
     if (OGR_L_TestCapability(Map->fInfo.ogr.layer, OLCTransactions))
 	OGR_L_CommitTransaction(Map->fInfo.ogr.layer);