Commit d6bd8013 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

pk: Make sure we are not creating empty elements on the hash

parent 62d595f2
......@@ -423,7 +423,7 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
if (!filter.resourceUrl.isEmpty()) {
return findResourceByPackageName(filter.resourceUrl);
} else if (!filter.extends.isEmpty()) {
const auto ext = kTransform<QVector<AbstractResource*>>(m_packages.extendedBy[filter.extends], [](AppPackageKitResource* a){ return a; });
const auto ext = kTransform<QVector<AbstractResource*>>(m_packages.extendedBy.value(filter.extends), [](AppPackageKitResource* a){ return a; });
return new ResultsStream(QStringLiteral("PackageKitStream-extends"), ext);
} else if ( {
return new ResultsStream(QStringLiteral("PackageKitStream-all"), kFilter<QVector<AbstractResource*>>(m_packages.packages, [](AbstractResource* res) { return res->type() != AbstractResource::Technical && !qobject_cast<PackageKitResource*>(res)->extendsItself(); }));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment