Skip to content

Commit b6c2529

Browse files
committed
Avoid error box when mouse coordinate transform fails
1 parent 87661a0 commit b6c2529

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core/qgscoordinateutils.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ QString QgsCoordinateUtils::formatCoordinateForProject( const QgsPoint& point, c
6868
{
6969
// need to transform to geographic coordinates
7070
QgsCoordinateTransform ct( destCrs, QgsCoordinateReferenceSystem( GEOSRID ) );
71-
geo = ct.transform( point );
71+
try
72+
{
73+
geo = ct.transform( point );
74+
}
75+
catch ( QgsCsException& )
76+
{
77+
return QString();
78+
}
7279
}
7380

7481
if ( format == "DM" )

0 commit comments

Comments
 (0)