From 2d6431cafa98337373cc5baab4492df11580c1b3 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 8 Dec 2008 15:59:05 +0000 Subject: [PATCH] don't crash when a runner that doesn't exist is requested BUGS:170989,177162 svn path=/trunk/KDE/kdelibs/; revision=894424 --- runnermanager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/runnermanager.cpp b/runnermanager.cpp index e01e9d5e8..0fcf3863a 100644 --- a/runnermanager.cpp +++ b/runnermanager.cpp @@ -346,7 +346,11 @@ AbstractRunner *RunnerManager::runner(const QString &name) const d->loadRunners(); } - return d->runners.value(name); + if (d->runners.contains(name)) { + return d->runners.value(name); + } + + return 0; } RunnerContext *RunnerManager::searchContext() const @@ -428,7 +432,10 @@ void RunnerManager::launchQuery(const QString &term, const QString &runnerName) //if the name is not empty we will launch only the specified runner if (!runnerName.isEmpty()) { - runable.append(runner(runnerName)); + AbstractRunner *r = runner(runnerName); + if (r) { + runable.append(r); + } } else { runable = d->runners.values(); }