Skip to content
Permalink
Browse files

Gracefully catch transform errors in rubber band geometries

  • Loading branch information
nyalldawson authored and github-actions committed Feb 23, 2021
1 parent b2f8045 commit f76ed50da1e4ff539a400beb41d675c6440d3a72
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 f76ed50

Please sign in to comment.