瀏覽代碼

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 年之前
父節點
當前提交
6ba15c3c3b
共有 1 個文件被更改,包括 5 次插入0 次删除
  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);