diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index e5cd13cf18f..788b88d6751 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -1771,7 +1771,17 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f } if ( ct ) // reproject the geometry if necessary - geom->transform( *ct ); + { + try + { + geom->transform( *ct ); + } + catch ( QgsCsException &cse ) + { + QgsDebugMsgLevel( QString( "Ignoring feature %1 due transformation exception" ).arg( f.id() ), 4 ); + return; + } + } if ( !checkMinimumSizeMM( context, geom, minFeatureSize ) ) { @@ -2069,7 +2079,15 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f double z = 0; if ( ct ) { - ct->transformInPlace( xPos, yPos, z ); + try + { + ct->transformInPlace( xPos, yPos, z ); + } + catch ( QgsCsException &e ) + { + QgsDebugMsgLevel( QString( "Ignoring feature %1 due transformation exception on data-defined position" ).arg( f.id() ), 4 ); + return; + } } xPos += xdiff;