Skip to content

Commit

Permalink
Gracefully catch transform errors in rubber band geometries
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 24, 2021
1 parent 23ab2d7 commit f2b6730
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/qgsrubberband.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit f2b6730

Please sign in to comment.