summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2017-01-23 18:26:16 +0100
committerAleix Pol <[email protected]>2017-01-23 18:26:16 +0100
commit09e910d0f1e350fa85520c8964a16e999ff604fa (patch)
tree22a93fdcd3613f1f2e57ac452548e56e1159dd0b
parent6579c2b4be28bd8d710c08f55e1c9717916a2419 (diff)
Don't emit null resources
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
index 9a98c7c..1f2067b 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
+++ b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
@@ -325,8 +325,10 @@ void PackageKitBackend::includePackagesToAdd()
const auto pkgs = m_packages.packageToApp.value(res->packageName(), {res->packageName()});
foreach(const auto &pkg, pkgs) {
auto res = m_packages.packages.take(pkg);
- emit resourceRemoved(res);
- res->deleteLater();
+ if (res) {
+ emit resourceRemoved(res);
+ res->deleteLater();
+ }
}
}
m_packagesToAdd.clear();