diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-02-28 21:49:39 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-02-28 21:49:39 +0100 |
commit | 2817b7918af638f93c37ad8066886eecd47dc7ca (patch) | |
tree | db4ce685d6318f95eb524c0e1faecd46765e7b3c | |
parent | Clean up all d-tors to fix an eventual crash on exit (diff) | |
download | rekonq-2817b7918af638f93c37ad8066886eecd47dc7ca.tar.xz |
Do NOT take the first element of an empty list
BUG: 261003
-rw-r--r-- | src/urlbar/completionwidget.cpp | 11 |
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(); |