diff --git a/src/libtomahawk/database/DatabaseCommand_Resolve.cpp b/src/libtomahawk/database/DatabaseCommand_Resolve.cpp index 23004bec6..687f25ab2 100644 --- a/src/libtomahawk/database/DatabaseCommand_Resolve.cpp +++ b/src/libtomahawk/database/DatabaseCommand_Resolve.cpp @@ -58,7 +58,7 @@ DatabaseCommand_Resolve::exec( DatabaseImpl* lib ) tDebug() << "Using result-hint to speed up resolving:" << m_query->resultHint(); Tomahawk::result_ptr result = lib->resultFromHint( m_query ); - if ( !result.isNull() && ( result->collection().isNull() || result->collection()->source()->isOnline() ) ) + if ( result && ( !result->collection() || result->collection()->source()->isOnline() ) ) { QList res; res << result; diff --git a/src/libtomahawk/database/DatabaseImpl.cpp b/src/libtomahawk/database/DatabaseImpl.cpp index 5c5403df0..7471a173a 100644 --- a/src/libtomahawk/database/DatabaseImpl.cpp +++ b/src/libtomahawk/database/DatabaseImpl.cpp @@ -659,7 +659,7 @@ Tomahawk::DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery ) query.bindValue( 0, fileUrl ); query.exec(); - if( query.next() ) + if ( query.next() ) { QString url = query.value( 0 ).toString(); Tomahawk::source_ptr s = SourceList::instance()->get( query.value( 15 ).toUInt() );