mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-20 14:33:19 +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:
parent
b3f838216f
commit
8be65b8565
@ -236,8 +236,11 @@ void GlobalSearchModel::GetChildResults(
|
||||
GetChildResults(itemFromIndex(index), results, visited);
|
||||
}
|
||||
} else {
|
||||
// No - it's a song, add its result
|
||||
results->append(item->data(Role_Result).value<SearchProvider::Result>());
|
||||
// No - maybe it's a song, add its result if valid
|
||||
QVariant result = item->data(Role_Result);
|
||||
if (result.isValid()) {
|
||||
results->append(result.value<SearchProvider::Result>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user