Skip to content
Permalink
Browse files

Add safety guard when mDataProvider is not set

  • Loading branch information
mbernasocchi committed Feb 19, 2019
1 parent 7949046 commit 0514df7ebc2851fe792c82f826b0a5d63d922269
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/core/qgsvectorlayer.cpp
@@ -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 );
}

0 comments on commit 0514df7

Please sign in to comment.
You can’t perform that action at this time.