Navigation Menu

Skip to content

Commit

Permalink
avoid crash on retrieval extent from invalid vector data providers
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 5, 2019
1 parent 943492e commit 6564da0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -771,7 +771,7 @@ QgsRectangle QgsVectorLayer::extent() const
mLazyExtent = false;
}

if ( !mValidExtent && mLazyExtent && mDataProvider )
if ( !mValidExtent && mLazyExtent && mDataProvider && mDataProvider->isValid() )
{
// get the extent
QgsRectangle mbr = mDataProvider->extent();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -3224,7 +3224,7 @@ bool QgsPostgresProvider::empty() const

QgsRectangle QgsPostgresProvider::extent() const
{
if ( mGeometryColumn.isNull() )
if ( !isValid() || mGeometryColumn.isNull() )
return QgsRectangle();

if ( mSpatialColType == SctGeography )
Expand Down

0 comments on commit 6564da0

Please sign in to comment.