Skip to content

Commit

Permalink
Fix crash when trying to initialize snapping on invalid layer
Browse files Browse the repository at this point in the history
Fixes an unreported crasher
  • Loading branch information
m-kuhn authored and nyalldawson committed Jul 15, 2020
1 parent 9ceb806 commit 27d3a4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/qgspointlocator.cpp
Expand Up @@ -831,6 +831,10 @@ bool QgsPointLocator::init( int maxFeaturesToIndex, bool relaxed )
|| mIsIndexing ) // already indexing, return!
return true;

if ( !mLayer->dataProvider()
|| !mLayer->dataProvider()->isValid() )
return false;

mRenderer.reset( mLayer->renderer() ? mLayer->renderer()->clone() : nullptr );
mSource.reset( new QgsVectorLayerFeatureSource( mLayer ) );

Expand Down

0 comments on commit 27d3a4b

Please sign in to comment.