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

flatpak: Do not call flatpak function with a nullptr

BUG: 445819


(cherry picked from commit 98aced4c)
parent 1e289501
......@@ -61,7 +61,7 @@ void FlatpakJobTransaction::finishTransaction()
m_app->setState(AbstractResource::None);
}
if (!m_appJob->errorMessage().isEmpty()) {
if (!m_appJob->cancelled() && !m_appJob->errorMessage().isEmpty()) {
Q_EMIT passiveMessage(m_appJob->errorMessage());
}
......
......@@ -608,7 +608,9 @@ QString FlatpakResource::versionString()
}
if (isInstalled()) {
auto ref = qobject_cast<FlatpakBackend *>(backend())->getInstalledRefForApp(this);
version = flatpak_installed_ref_get_appdata_version(ref);
if (ref) {
version = flatpak_installed_ref_get_appdata_version(ref);
}
} else if (!m_appdata.releases().isEmpty()) {
auto release = m_appdata.releases().constFirst();
version = release.version();
......
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