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

flatpak: Don't try to parse nullptr metadata

parent bd202e12
Pipeline #142191 passed with stage
in 1 minute and 9 seconds
......@@ -422,15 +422,17 @@ FlatpakResource *FlatpakBackend::getAppForInstalledRef(FlatpakInstallation *inst
if (comps.isEmpty()) {
g_autoptr(GBytes) metadata = flatpak_installed_ref_load_appdata(ref, 0, 0);
auto meta = metadataFromBytes(metadata, m_cancellable);
const auto componentsProvided = meta->components();
if (!componentsProvided.isEmpty() && name != componentsProvided.constFirst().id()) {
qDebug() << "mismatch between flatpak and appstream" << name << componentsProvided.constFirst().id();
comps = source->m_pool->componentsById(componentsProvided.constFirst().id());
}
if (metadata) {
auto meta = metadataFromBytes(metadata, m_cancellable);
const auto componentsProvided = meta->components();
if (!componentsProvided.isEmpty() && name != componentsProvided.constFirst().id()) {
qDebug() << "mismatch between flatpak and appstream" << name << componentsProvided.constFirst().id();
comps = source->m_pool->componentsById(componentsProvided.constFirst().id());
}
if (comps.isEmpty()) {
comps = componentsProvided;
if (comps.isEmpty()) {
comps = componentsProvided;
}
}
}
......
Supports Markdown
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