Skip to content

Commit

Permalink
Fix QgsVectorLayer::hasFeatures() crash when editable
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 4, 2018
1 parent eff4bf9 commit 48a796d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayer.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2767,8 +2767,8 @@ long QgsVectorLayer::featureCount() const


QgsFeatureSource::FeatureAvailability QgsVectorLayer::hasFeatures() const QgsFeatureSource::FeatureAvailability QgsVectorLayer::hasFeatures() const
{ {
const QgsFeatureIds deletedFeatures = mEditBuffer->deletedFeatureIds(); const QgsFeatureIds deletedFeatures( mEditBuffer ? mEditBuffer->deletedFeatureIds() : QgsFeatureIds() );
const QgsFeatureMap addedFeatures = mEditBuffer->addedFeatures(); const QgsFeatureMap addedFeatures( mEditBuffer ? mEditBuffer->addedFeatures() : QgsFeatureMap() );


if ( mEditBuffer && !deletedFeatures.empty() ) if ( mEditBuffer && !deletedFeatures.empty() )
{ {
Expand Down

0 comments on commit 48a796d

Please sign in to comment.