Skip to content

Commit

Permalink
Do not die when passed invalid full extent from QGIS
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Sep 15, 2017
1 parent 81c591c commit 0f692bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 0f692bb

Please sign in to comment.