Skip to content
Permalink
Browse files

Fix #12050 - possible crash on launch

Do not allow infinite recursion setExtent() -> setCenter() -> setExtent()
  • Loading branch information
wonder-sk committed Feb 17, 2015
1 parent 8eab61d commit ffd7f8a85d12dfcbcbadfb6c3658ad7afa521b8d
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/gui/qgsmapcanvas.cpp
@@ -843,6 +843,14 @@ void QgsMapCanvas::setExtent( QgsRectangle const & r )

if ( r.isEmpty() )
{
if ( !mSettings.hasValidSettings() )
{
// we can't even just move the map center
QgsDebugMsg( "Empty extent - ignoring" );
return;
}

// ### QGIS 3: do not allow empty extent - require users to call setCenter() explicitly
QgsDebugMsg( "Empty extent - keeping old scale with new center!" );
setCenter( r.center() );
}

0 comments on commit ffd7f8a

Please sign in to comment.
You can’t perform that action at this time.