summaryrefslogtreecommitdiff
path: root/kde-plasma/plasma-workspace/files/plasma-workspace-5.23.4-fix-systemsettings-crash.patch
blob: d46f334867857d2a0c8c217829dac12c170353fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From a8b613505e326dd047707e0a0e4d6f5ecc4a9baa Mon Sep 17 00:00:00 2001
From: Alexander Lohnau <alexander.lohnau@gmx.de>
Date: Wed, 8 Dec 2021 18:25:36 +0100
Subject: [PATCH] lookandfeel: Add missing check if list of files is empty

BUG: 439797


(cherry picked from commit d168d2a50366c528dab65415cd4f6e82afdfb645)
---
 kcms/lookandfeel/kcm.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kcms/lookandfeel/kcm.cpp b/kcms/lookandfeel/kcm.cpp
index 75ce19197..349761aad 100644
--- a/kcms/lookandfeel/kcm.cpp
+++ b/kcms/lookandfeel/kcm.cpp
@@ -123,7 +123,9 @@ void KCMLookandFeel::knsEntryChanged(KNSCore::EntryWrapper *wrapper)
     if (entry.status() == KNS3::Entry::Deleted && !entry.uninstalledFiles().isEmpty()) {
         removeItemFromModel();
     } else if (entry.status() == KNS3::Entry::Installed && !entry.installedFiles().isEmpty()) {
-        removeItemFromModel(); // In case we updated it we don't want to have it in twice
+        if (!entry.uninstalledFiles().isEmpty()) {
+            removeItemFromModel(); // In case we updated it we don't want to have it in twice
+        }
         KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel"));
         pkg.setPath(entry.installedFiles().constFirst());
         addKPackageToModel(pkg);
-- 
GitLab