Skip to content

Commit

Permalink
Fix search bar crash when invalid layers are present
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Nov 21, 2024
1 parent 1abd621 commit 03e3ab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/locator/featureslocatorfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ QStringList FeaturesLocatorFilter::prepare( const QString &string, const QgsLoca
for ( auto it = layers.constBegin(); it != layers.constEnd(); ++it )
{
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( it.value() );
if ( !layer || !layer->dataProvider() || !layer->flags().testFlag( QgsMapLayer::Searchable ) )
if ( !layer || !layer->isValid() || !layer->dataProvider() || !layer->flags().testFlag( QgsMapLayer::Searchable ) )
continue;

QgsExpression expression( layer->displayExpression() );
Expand Down

0 comments on commit 03e3ab6

Please sign in to comment.