From 368143329eaee34c4da0874a29065791ab4dc1dc Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 11 Sep 2021 06:36:28 +0200 Subject: [PATCH] Protect agains messed up plamashell config In case the config was written before 5b8f8bd12, a malformed value is written Otherwise plasmashell could not be started at all --- shell/shellcorona.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp index 54229e375..5b33883f0 100644 --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -2128,7 +2128,11 @@ QString ShellCorona::defaultShell() { KSharedConfig::Ptr startupConf = KSharedConfig::openConfig(QStringLiteral("plasmashellrc")); KConfigGroup startupConfGroup(startupConf, "Shell"); - return startupConfGroup.readEntry("ShellPackage", qEnvironmentVariable("PLASMA_DEFAULT_SHELL", "org.kde.plasma.desktop")); + const QString defaultValue = qEnvironmentVariable("PLASMA_DEFAULT_SHELL", "org.kde.plasma.desktop"); + QString value = startupConfGroup.readEntry("ShellPackage", defaultValue); + + // In the global theme an empty value was written, make sure we still return a shell package + return value.isEmpty() ? defaultValue : value; } void ShellCorona::refreshCurrentShell()