1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-20 22:34:37 +01:00

Better check (avoid to add invalid results, leading to a crash when adding this invalid item).

Fixes issue 3132, but I would like to improve this in a second step: clicking the provider adding all the songs for this provider to the playlist.
This commit is contained in:
Arnaud Bienner 2014-09-13 21:31:33 +02:00
parent b3f838216f
commit 8be65b8565

View File

@ -236,8 +236,11 @@ void GlobalSearchModel::GetChildResults(
GetChildResults(itemFromIndex(index), results, visited); GetChildResults(itemFromIndex(index), results, visited);
} }
} else { } else {
// No - it's a song, add its result // No - maybe it's a song, add its result if valid
results->append(item->data(Role_Result).value<SearchProvider::Result>()); QVariant result = item->data(Role_Result);
if (result.isValid()) {
results->append(result.value<SearchProvider::Result>());
}
} }
} }