[QGIS Commit] r11539 - trunk/qgis/src/providers/ogr

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Sep 2 15:52:17 EDT 2009


Author: jef
Date: 2009-09-02 15:52:16 -0400 (Wed, 02 Sep 2009)
New Revision: 11539

Modified:
   trunk/qgis/src/providers/ogr/qgsogrprovider.cpp
Log:
fix #1915

Modified: trunk/qgis/src/providers/ogr/qgsogrprovider.cpp
===================================================================
--- trunk/qgis/src/providers/ogr/qgsogrprovider.cpp	2009-09-01 17:50:56 UTC (rev 11538)
+++ trunk/qgis/src/providers/ogr/qgsogrprovider.cpp	2009-09-02 19:52:16 UTC (rev 11539)
@@ -373,7 +373,7 @@
   while (( fet = OGR_L_GetNextFeature( ogrLayer ) ) != NULL )
   {
     // skip features without geometry
-    if ( OGR_F_GetGeometryRef( fet ) == NULL && !mFetchFeaturesWithoutGeom )
+    if ( !mFetchFeaturesWithoutGeom && OGR_F_GetGeometryRef( fet ) == NULL )
     {
       OGR_F_Destroy( fet );
       continue;
@@ -389,6 +389,12 @@
     {
       OGRGeometryH geom = OGR_F_GetGeometryRef( fet );
 
+      if ( geom == 0 )
+      {
+        OGR_F_Destroy( fet );
+        continue;
+      }
+
       // get the wkb representation
       unsigned char *wkb = new unsigned char[OGR_G_WkbSize( geom )];
       OGR_G_ExportToWkb( geom, ( OGRwkbByteOrder ) QgsApplication::endian(), wkb );



More information about the QGIS-commit mailing list