diff --git a/src/libtomahawk/DropJob.cpp b/src/libtomahawk/DropJob.cpp index 17f517a2f..4ff08893a 100644 --- a/src/libtomahawk/DropJob.cpp +++ b/src/libtomahawk/DropJob.cpp @@ -263,9 +263,14 @@ bool DropJob::validateLocalFiles(const QString &paths, const QString &suffix) { QStringList filePaths = paths.split( QRegExp( "\\s+" ), QString::SkipEmptyParts ); - for ( QStringList::iterator it = filePaths.begin(); it != filePaths.end(); ++it ) + QStringList::iterator it = filePaths.begin(); + while (it != filePaths.end()) + { if ( !validateLocalFile( *it, suffix ) ) - filePaths.erase( it ); + it = filePaths.erase( it ); + else + ++it; + } return !filePaths.isEmpty(); } @@ -977,7 +982,7 @@ DropJob::removeRemoteSources() foreach ( const Tomahawk::result_ptr& result, item->results() ) { if ( !result->collection().isNull() && !result->collection()->source().isNull() && - !result->collection()->source().isNull() && result->collection()->source()->isLocal() ) + result->collection()->source()->isLocal() ) hasLocalSource = true; } if ( hasLocalSource )