Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Gracefully catch transform errors in rubber band geometries
  • Loading branch information
nyalldawson committed Feb 23, 2021
1 parent b2f8045 commit ab59e37
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 ab59e37

Please sign in to comment.