diff --git a/src/globalsearch/globalsearchmodel.cpp b/src/globalsearch/globalsearchmodel.cpp index 0ff0b4655..c5b381fe3 100644 --- a/src/globalsearch/globalsearchmodel.cpp +++ b/src/globalsearch/globalsearchmodel.cpp @@ -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()); + // No - maybe it's a song, add its result if valid + QVariant result = item->data(Role_Result); + if (result.isValid()) { + results->append(result.value()); + } } }