Skip to content
Permalink
Browse files

Gracefully catch transform errors in rubber band geometries

  • Loading branch information
nyalldawson committed Feb 23, 2021
1 parent b2f8045 commit ab59e37bcdd4eddc2e2c29c3cd00870d715f5ddb
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/gui/qgsrubberband.cpp
@@ -311,7 +311,15 @@ void QgsRubberBand::addGeometry( const QgsGeometry &geometry, const QgsCoordinat
if ( crs.isValid() )
{
QgsCoordinateTransform ct( crs, ms.destinationCrs(), QgsProject::instance() );
geom.transform( ct );
try
{
geom.transform( ct );
}
catch ( QgsCsException & )
{
QgsDebugMsg( QStringLiteral( "Could not transform rubber band geometry to map CRS" ) );
return;
}
}

QgsWkbTypes::Type geomType = geom.wkbType();

0 comments on commit ab59e37

Please sign in to comment.