Skip to content

Commit 6bea923

Browse files
author
jef
committed
fix #1915
git-svn-id: http://svn.osgeo.org/qgis/trunk@11539 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 1f05829 commit 6bea923

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/providers/ogr/qgsogrprovider.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
373373
while (( fet = OGR_L_GetNextFeature( ogrLayer ) ) != NULL )
374374
{
375375
// skip features without geometry
376-
if ( OGR_F_GetGeometryRef( fet ) == NULL && !mFetchFeaturesWithoutGeom )
376+
if ( !mFetchFeaturesWithoutGeom && OGR_F_GetGeometryRef( fet ) == NULL )
377377
{
378378
OGR_F_Destroy( fet );
379379
continue;
@@ -389,6 +389,12 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
389389
{
390390
OGRGeometryH geom = OGR_F_GetGeometryRef( fet );
391391

392+
if ( geom == 0 )
393+
{
394+
OGR_F_Destroy( fet );
395+
continue;
396+
}
397+
392398
// get the wkb representation
393399
unsigned char *wkb = new unsigned char[OGR_G_WkbSize( geom )];
394400
OGR_G_ExportToWkb( geom, ( OGRwkbByteOrder ) QgsApplication::endian(), wkb );

0 commit comments

Comments
 (0)