Commit f2d87ea7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Fix crash when rendering a delegate that extends an unexisting component

BUG: 394048
parent 5d659363
......@@ -46,9 +46,14 @@ QString AppPackageKitResource::name() const
QString ret;
if (!m_appdata.extends().isEmpty()) {
auto components = backend()->componentsById(m_appdata.extends().constFirst());
Q_ASSERT(!components.isEmpty());
ret = components.constFirst().name() + QStringLiteral(" - ") + m_appdata.name();
} else
if (components.isEmpty())
qWarning() << "couldn't find" << m_appdata.extends() << "which is supposedly extended by" << m_appdata.id();
else
ret = components.constFirst().name() + QStringLiteral(" - ") + m_appdata.name();
}
if (ret.isEmpty())
ret = m_appdata.name();
return ret;
}
......
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