From 2817b7918af638f93c37ad8066886eecd47dc7ca Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 28 Feb 2011 21:49:39 +0100 Subject: Do NOT take the first element of an empty list BUG: 261003 --- src/urlbar/completionwidget.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.1