Handle None-tab in on_current_changed

This commit is contained in:
Florian Bruhin 2016-11-08 10:36:40 +01:00
parent 7e6edaf93d
commit f271081012

View File

@ -558,6 +558,11 @@ class TabbedBrowser(tabwidget.TabWidget):
# closing the last tab (before quitting) or shutting down
return
tab = self.widget(idx)
if tab is None:
log.webview.debug("on_current_changed got called with invalid "
"index {}".format(idx))
return
log.modes.debug("Current tab changed, focusing {!r}".format(tab))
tab.setFocus()
for mode in [usertypes.KeyMode.hint, usertypes.KeyMode.insert,