Skip to content
Permalink
Browse files
Trace error instead of crash for bad implemented locator filters
  • Loading branch information
domi4484 authored and nyalldawson committed Nov 4, 2021
1 parent 19c503f commit a2af615d58654405a565cdd981aa0fc488e5f4f4
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/locator/qgslocator.cpp
@@ -16,6 +16,7 @@
***************************************************************************/

#include "qgslocator.h"
#include "qgsmessagelog.h"
#include "qgssettings.h"
#include <QtConcurrent>
#include <functional>
@@ -183,6 +184,11 @@ void QgsLocator::fetchResults( const QString &string, const QgsLocatorContext &c
{
filter->clearPreviousResults();
std::unique_ptr< QgsLocatorFilter > clone( filter->clone() );
if ( ! clone )
{
QgsMessageLog::logMessage( QObject::tr( "QgsLocatorFilter '%1' could not provide a valid clone" ).arg( filter->name() ), QString(), Qgis::MessageLevel::Critical );
continue;
}
connect( clone.get(), &QgsLocatorFilter::resultFetched, clone.get(), [this, filter]( QgsLocatorResult result )
{
result.filter = filter;

0 comments on commit a2af615

Please sign in to comment.