[plasma/kactivitymanagerd] src/service/plugins/sqlite: StatsPlugin: Do not crash with wrong dbus calls

Akseli Lahtinen <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 3e1312c7f098c4349429d8a83ba1efdaac6d444f by Akseli Lahtinen.
Committed on 18/08/2026 at 09:13.
Pushed by akselmo into branch 'master'.

StatsPlugin: Do not crash with wrong dbus calls

If user sends a dbus call that has no proper parameter, the
params here would end up being empty.

In those cases, just return false, instead of
assert crashing on empty stringlist.

CCBUG: 524352

M  +1    -1    src/service/plugins/sqlite/StatsPlugin.cpp

https://invent.kde.org/plasma/kactivitymanagerd/-/commit/3e1312c7f098c4349429d8a83ba1efdaac6d444f

diff --git a/src/service/plugins/sqlite/StatsPlugin.cpp b/src/service/plugins/sqlite/StatsPlugin.cpp
index abd11aee..fabe69e2 100644
--- a/src/service/plugins/sqlite/StatsPlugin.cpp
+++ b/src/service/plugins/sqlite/StatsPlugin.cpp
@@ -574,7 +574,7 @@ void StatsPlugin::DeleteStatsForResource(const QString &activity, const QString
 
 bool StatsPlugin::isFeatureOperational(const QStringList &feature) const
 {
-    if (feature[0] == "isOTR") {
+    if (!feature.isEmpty() && feature[0] == "isOTR") {
         if (feature.size() != 2)
             return true;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.