Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add safety guard when mDataProvider is not set
  • Loading branch information
mbernasocchi committed Feb 19, 2019
1 parent 7949046 commit 0514df7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -2891,6 +2891,8 @@ QgsAttributeList QgsVectorLayer::primaryKeyAttributes() const

long QgsVectorLayer::featureCount() const
{
if ( ! mDataProvider )
return 0;
return mDataProvider->featureCount() +
( mEditBuffer ? mEditBuffer->mAddedFeatures.size() - mEditBuffer->mDeletedFeatureIds.size() : 0 );
}
Expand Down

0 comments on commit 0514df7

Please sign in to comment.