Skip to content

Commit ffd7f8a

Browse files
committedFeb 17, 2015
Fix #12050 - possible crash on launch
Do not allow infinite recursion setExtent() -> setCenter() -> setExtent()
1 parent 8eab61d commit ffd7f8a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,14 @@ void QgsMapCanvas::setExtent( QgsRectangle const & r )
843843

844844
if ( r.isEmpty() )
845845
{
846+
if ( !mSettings.hasValidSettings() )
847+
{
848+
// we can't even just move the map center
849+
QgsDebugMsg( "Empty extent - ignoring" );
850+
return;
851+
}
852+
853+
// ### QGIS 3: do not allow empty extent - require users to call setCenter() explicitly
846854
QgsDebugMsg( "Empty extent - keeping old scale with new center!" );
847855
setCenter( r.center() );
848856
}

0 commit comments

Comments
 (0)
Please sign in to comment.