Skip to content
Permalink
Browse files

avoid crash on retrieval extent from invalid vector data providers

  • Loading branch information
jef-n committed Mar 4, 2019
1 parent 943492e commit 6564da037c5ad40550a5606a71a707e00b811765
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/qgsvectorlayer.cpp
  2. +1 −1 src/providers/postgres/qgspostgresprovider.cpp
@@ -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();
@@ -3224,7 +3224,7 @@ bool QgsPostgresProvider::empty() const

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

if ( mSpatialColType == SctGeography )

0 comments on commit 6564da0

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