[applets kicker] Move safety check to a more useful place

The early return obviously needs to be before we use argument.at(0);

Found by the code quality checker on invent
wilder-5.24
David Edmundson 4 years ago committed by Nate Graham
parent 440ec1c609
commit d1f9dc087d
  1. 7
      applets/kicker/plugin/actionlist.cpp

@ -345,6 +345,9 @@ bool handleRecentDocumentAction(KService::Ptr service, const QString &actionId,
}
const QStringList argument = _argument.toStringList();
if (argument.isEmpty()) {
return false;
}
const auto resource = argument.at(0);
const auto mimeType = argument.at(1);
@ -362,10 +365,6 @@ bool handleRecentDocumentAction(KService::Ptr service, const QString &actionId,
}
}
if (argument.isEmpty()) {
return false;
}
auto *job = new KIO::ApplicationLauncherJob(service);
job->setUrls({QUrl::fromUserInput(resource)});
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));

Loading…
Cancel
Save