summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-02-28 21:49:39 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-02-28 21:49:39 +0100
commit2817b7918af638f93c37ad8066886eecd47dc7ca (patch)
treedb4ce685d6318f95eb524c0e1faecd46765e7b3c /src/urlbar
parentClean up all d-tors to fix an eventual crash on exit (diff)
downloadrekonq-2817b7918af638f93c37ad8066886eecd47dc7ca.tar.xz
Do NOT take the first element of an empty list
BUG: 261003
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/completionwidget.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp
index 465f5cf5..c8209fbc 100644
--- a/src/urlbar/completionwidget.cpp
+++ b/src/urlbar/completionwidget.cpp
@@ -308,7 +308,16 @@ bool CompletionWidget::eventFilter(QObject *obj, QEvent *ev)
else //the user type too fast (completionwidget not visible or suggestion not downloaded)
{
UrlResolver res(w->text());
- emit chosenUrl(res.orderedSearchItems().first().url, Rekonq::CurrentTab);
+ UrlSearchList list = res.orderedSearchItems();
+ if(list.isEmpty())
+ {
+ kDebug() << "Url Search List EMPTY!!!";
+ emit chosenUrl(KUrl(_typedString), Rekonq::CurrentTab);
+ }
+ else
+ {
+ emit chosenUrl(list.first().url, Rekonq::CurrentTab);
+ }
}
kev->accept();
hide();