1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Don't crash if Rovi returns no results

This commit is contained in:
Leo Franchi 2011-10-28 15:45:52 -04:00
parent 5eef57f3b8
commit 7549d73115

View File

@ -149,7 +149,13 @@ RoviPlugin::albumLookupFinished()
return;
}
QVariantMap results = response[ "searchResponse" ].toMap().value( "results" ).toList().first().toMap();
QVariantList resultList = response[ "searchResponse" ].toMap().value( "results" ).toList();
if ( resultList.size() == 0 )
{
emit info( requestData, QVariant() );
}
QVariantMap results = resultList.first().toMap();
QVariantList tracks = results[ "album" ].toMap()[ "tracks" ].toList();
if ( tracks.isEmpty() )