Fix AttributeError when doing extended hinting.

This commit is contained in:
Florian Bruhin 2015-02-27 08:44:44 +01:00
parent 561ebd07f9
commit bfd0a3fbc2

View File

@ -417,7 +417,9 @@ class BrowserPage(QWebPage):
Args:
hint_target: A string to set self._hint_target to.
"""
t = getattr(usertypes.ClickTarget, hint_target)
t = getattr(usertypes.ClickTarget, hint_target, None)
if t is None:
return
log.webview.debug("Setting force target to {}/{}".format(
hint_target, t))
self._hint_target = t