Skip to content
Permalink
Browse files

Fix crash when trying to initialize snapping on invalid layer

  • Loading branch information
github-actions authored and nyalldawson committed Jul 15, 2020
1 parent ba1c07e commit e5e67c31b4811d6966465e1ef573dd32b89a6f61
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 e5e67c3

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