We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4eecfb9 commit 09c85cdCopy full SHA for 09c85cd
src/core/qgsvectorlayer.cpp
@@ -771,7 +771,7 @@ QgsRectangle QgsVectorLayer::extent() const
771
mLazyExtent = false;
772
}
773
774
- if ( !mValidExtent && mLazyExtent && mDataProvider )
+ if ( !mValidExtent && mLazyExtent && mDataProvider && mDataProvider->isValid() )
775
{
776
// get the extent
777
QgsRectangle mbr = mDataProvider->extent();
src/providers/postgres/qgspostgresprovider.cpp
@@ -3224,7 +3224,7 @@ bool QgsPostgresProvider::empty() const
3224
3225
QgsRectangle QgsPostgresProvider::extent() const
3226
3227
- if ( mGeometryColumn.isNull() )
+ if ( !isValid() || mGeometryColumn.isNull() )
3228
return QgsRectangle();
3229
3230
if ( mSpatialColType == SctGeography )
0 commit comments