Skip to content

Commit

Permalink
fix #1915
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11539 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 2, 2009
1 parent 1f05829 commit 6bea923
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -373,7 +373,7 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
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;
Expand All @@ -389,6 +389,12 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
{
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 );
Expand Down

0 comments on commit 6bea923

Please sign in to comment.