Skip to content
Permalink
Browse files

Do not die when passed invalid full extent from QGIS

  • Loading branch information
wonder-sk committed Aug 10, 2017
1 parent 81c591c commit 0f692bba129e13c97eec32ce8dbf6134a57619fb
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/app/qgisapp.cpp
@@ -9907,6 +9907,14 @@ void QgisApp::new3DMapCanvas()
QgsProject *prj = QgsProject::instance();
QgsRectangle fullExtent = mMapCanvas->fullExtent();

// some layers may go crazy and make full extent unusable
// we can't go any further - invalid extent would break everything
if ( fullExtent.isEmpty() || !fullExtent.isFinite() )
{
QMessageBox::warning( this, tr( "Error" ), tr( "Project extent is not valid." ) );
return;
}

Map3D *map = new Map3D;
map->crs = prj->crs();
map->originX = fullExtent.center().x();

0 comments on commit 0f692bb

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