From f271081012e69321d9cad1f4ebdc6c0193a98d8e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 8 Nov 2016 10:36:40 +0100 Subject: [PATCH] Handle None-tab in on_current_changed --- qutebrowser/mainwindow/tabbedbrowser.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 6efec0851..e1a07146a 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -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,