Skip to content

Commit

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

Backported from master fe56531
  • Loading branch information
elpaso committed Nov 10, 2017
1 parent f80a705 commit 269038e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2923,6 +2923,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 269038e

Please sign in to comment.