From e65830643b9ac70142386ad324cade34a6ee2a12 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 23 Apr 2015 20:53:45 +0200 Subject: [PATCH] Don't create a ResultUrlChecker if there are no results to be checked. --- src/libtomahawk/Pipeline.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libtomahawk/Pipeline.cpp b/src/libtomahawk/Pipeline.cpp index af81d7167..81c7baebe 100644 --- a/src/libtomahawk/Pipeline.cpp +++ b/src/libtomahawk/Pipeline.cpp @@ -354,7 +354,7 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results ) QList< result_ptr > httpResults; foreach ( const result_ptr& r, results ) { - if ( r.isNull() ) + if ( !r ) continue; if ( !r->checked() && ( r->url().startsWith( "http" ) && !r->url().startsWith( "http://localhost" ) ) ) @@ -363,8 +363,11 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results ) cleanResults << r; } - const ResultUrlChecker* checker = new ResultUrlChecker( q, httpResults ); - connect( checker, SIGNAL( done() ), SLOT( onResultUrlCheckerDone() ) ); + if ( !httpResults.isEmpty() ) + { + const ResultUrlChecker* checker = new ResultUrlChecker( q, httpResults ); + connect( checker, SIGNAL( done() ), SLOT( onResultUrlCheckerDone() ) ); + } addResultsToQuery( q, cleanResults ); /* if ( q->solved() && !q->isFullTextQuery() )