File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
373
373
while (( fet = OGR_L_GetNextFeature ( ogrLayer ) ) != NULL )
374
374
{
375
375
// skip features without geometry
376
- if ( OGR_F_GetGeometryRef ( fet ) == NULL && ! mFetchFeaturesWithoutGeom )
376
+ if ( ! mFetchFeaturesWithoutGeom && OGR_F_GetGeometryRef ( fet ) == NULL )
377
377
{
378
378
OGR_F_Destroy ( fet );
379
379
continue ;
@@ -389,6 +389,12 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
389
389
{
390
390
OGRGeometryH geom = OGR_F_GetGeometryRef ( fet );
391
391
392
+ if ( geom == 0 )
393
+ {
394
+ OGR_F_Destroy ( fet );
395
+ continue ;
396
+ }
397
+
392
398
// get the wkb representation
393
399
unsigned char *wkb = new unsigned char [OGR_G_WkbSize ( geom )];
394
400
OGR_G_ExportToWkb ( geom, ( OGRwkbByteOrder ) QgsApplication::endian (), wkb );
You can’t perform that action at this time.
0 commit comments