Skip to content
Permalink
Browse files
new labeling: do not crash on invalid geometries
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14018 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Aug 6, 2010
1 parent ff71ad6 commit f6c132ab1cf6565f1f9027529aec51813ecb594b
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/qgspallabeling.cpp
@@ -416,6 +416,10 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
}

QgsGeometry* geom = f.geometry();
GEOSGeometry* geos_geom = geom->asGeos();
if ( geos_geom == NULL )
return; // invalid geometry

if ( ct != NULL ) // reproject the geometry if necessary
geom->transform( *ct );

@@ -424,7 +428,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
return;
}

QgsPalGeometry* lbl = new QgsPalGeometry( f.id(), labelText, GEOSGeom_clone( geom->asGeos() ) );
QgsPalGeometry* lbl = new QgsPalGeometry( f.id(), labelText, GEOSGeom_clone( geos_geom ) );

// record the created geometry - it will be deleted at the end.
geometries.append( lbl );

0 comments on commit f6c132a

Please sign in to comment.