From 9caac268732d749eb8b6ece9d099123247de205c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 21 Apr 2014 19:31:28 +0200 Subject: [PATCH] Handle no found elements to hint gracefully --- qutebrowser/browser/hints.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index a1f82e359..6af3a1706 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -25,6 +25,7 @@ from PyQt5.QtCore import pyqtSignal, QObject, QEvent, Qt from PyQt5.QtGui import QMouseEvent import qutebrowser.config.config as config +import qutebrowser.utils.message as message from qutebrowser.utils.keyparser import KeyParser @@ -265,6 +266,9 @@ class HintManager(QObject): # out of screen continue visible_elems.append(e) + if not visible_elems: + message.error("No elements found.") + return strings = self._hint_strings(visible_elems) for e, string in zip(visible_elems, strings): label = self._draw_label(e, string)