Skip to content
Permalink
Browse files

[bugfix][postgresql] Fix crashes on featureCount()

Fixes #17388

Needs backporting
  • Loading branch information
elpaso committed Nov 10, 2017
1 parent 2ca4ee5 commit fe5653101a57cc2a2b5d1d29b65fb3fdb1b6211a
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/providers/postgres/qgspostgresprovider.cpp
@@ -3098,6 +3098,12 @@ long QgsPostgresProvider::featureCount() const
if ( featuresCounted >= 0 )
return featuresCounted;

// See: https://issues.qgis.org/issues/17388 - QGIS crashes on featureCount())
if ( ! connectionRO() )
{
return 0;
}

// get total number of features
QString sql;

0 comments on commit fe56531

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