Skip to content
Permalink
Browse files

Gracefully catch transform errors in rubber band geometries

  • Loading branch information
nyalldawson committed Feb 23, 2021
1 parent 27e74a6 commit c238d46d2be1de69df873ebcd80863fe614616f3
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 c238d46

Please sign in to comment.