Skip to content
Permalink
Browse files

Fix crash when trying to initialize snapping on invalid layer

Fixes an unreported crasher
  • Loading branch information
m-kuhn authored and nyalldawson committed Jul 15, 2020
1 parent 9ceb806 commit 27d3a4bdcf367ff985208b24cee8d3926620a33c
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/qgspointlocator.cpp
@@ -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 ) );

0 comments on commit 27d3a4b

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