Skip to content

Commit 09c85cd

Browse files
jef-nnyalldawson
authored andcommitted
avoid crash on retrieval extent from invalid vector data providers
(cherry picked from commit 6564da0)
1 parent 4eecfb9 commit 09c85cd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/qgsvectorlayer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ QgsRectangle QgsVectorLayer::extent() const
771771
mLazyExtent = false;
772772
}
773773

774-
if ( !mValidExtent && mLazyExtent && mDataProvider )
774+
if ( !mValidExtent && mLazyExtent && mDataProvider && mDataProvider->isValid() )
775775
{
776776
// get the extent
777777
QgsRectangle mbr = mDataProvider->extent();

src/providers/postgres/qgspostgresprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3224,7 +3224,7 @@ bool QgsPostgresProvider::empty() const
32243224

32253225
QgsRectangle QgsPostgresProvider::extent() const
32263226
{
3227-
if ( mGeometryColumn.isNull() )
3227+
if ( !isValid() || mGeometryColumn.isNull() )
32283228
return QgsRectangle();
32293229

32303230
if ( mSpatialColType == SctGeography )

0 commit comments

Comments
 (0)