Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 ffd7f8a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -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() );
}
Expand Down

0 comments on commit ffd7f8a

Please sign in to comment.