Skip to content

Commit fe56531

Browse files
committedNov 10, 2017
[bugfix][postgresql] Fix crashes on featureCount()
Fixes #17388 Needs backporting
1 parent 2ca4ee5 commit fe56531

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3098,6 +3098,12 @@ long QgsPostgresProvider::featureCount() const
30983098
if ( featuresCounted >= 0 )
30993099
return featuresCounted;
31003100

3101+
// See: https://issues.qgis.org/issues/17388 - QGIS crashes on featureCount())
3102+
if ( ! connectionRO() )
3103+
{
3104+
return 0;
3105+
}
3106+
31013107
// get total number of features
31023108
QString sql;
31033109

0 commit comments

Comments
 (0)
Please sign in to comment.