plugins/krunner-integration: Fix crash

If the provided id doesn't have the expected format, the parts list will
have one or none items and parts[1] is going to crash.

SENTRY: KWIN-7K1
wilder/Plasma/6.3
Vlad Zahorodnii 1 year ago
parent 8c225cc96b
commit 7d57497ad6
  1. 8
      src/plugins/krunner-integration/windowsrunnerinterface.cpp

@ -197,8 +197,12 @@ void WindowsRunner::Run(const QString &id, const QString &actionId)
{
// Split id to get actionId and realId. We don't use actionId because our actions list is not constant
const QStringList parts = id.split(QLatin1Char('_'));
auto action = WindowsRunnerAction(parts[0].toInt());
auto objectId = parts[1];
if (parts.size() != 2) {
return;
}
const auto action = WindowsRunnerAction(parts[0].toInt());
const auto objectId = parts[1];
if (action == ActivateDesktopAction) {
QByteArray desktopId = objectId.toLocal8Bit();

Loading…
Cancel
Save