Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[bugfix][postgresql] Fix crashes on featureCount()
- Loading branch information
Showing
with
6 additions
and
0 deletions.
-
+6
−0
src/providers/postgres/qgspostgresprovider.cpp
|
@@ -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; |
|
|
|
|
|