Skip to content

Commit

Permalink
[bugfix][postgresql] Fix crashes on featureCount()
Browse files Browse the repository at this point in the history
Fixes #17388

Needs backporting
  • Loading branch information
elpaso committed Nov 10, 2017
1 parent 2ca4ee5 commit fe56531
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -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;

Expand Down

0 comments on commit fe56531

Please sign in to comment.