Skip to content

Commit

Permalink
Add zero pointer checks to avoid segfaults
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Sep 6, 2011
1 parent 67dfd2e commit 05cdd52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/qgspallabeling.cpp
Expand Up @@ -495,6 +495,10 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
}

QgsGeometry* geom = f.geometry();
if ( !geom )
{
return;
}

if ( ct ) // reproject the geometry if necessary
geom->transform( *ct );
Expand All @@ -511,6 +515,10 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
if ( do_clip )
{
geomClipped = geom->intersection( extentGeom ); // creates new geometry
if ( !geomClipped )
{
return;
}
geos_geom = geomClipped->asGeos();
}
else
Expand Down

0 comments on commit 05cdd52

Please sign in to comment.