From 6015bed7869dfead1574dc6e400492d98575a146 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 1 Aug 2014 14:27:57 +0200 Subject: [PATCH] widgets.tabbedbrowser: Fix closing tab with mouse. --- qutebrowser/widgets/tabbedbrowser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qutebrowser/widgets/tabbedbrowser.py b/qutebrowser/widgets/tabbedbrowser.py index 935e1ed20..774793624 100644 --- a/qutebrowser/widgets/tabbedbrowser.py +++ b/qutebrowser/widgets/tabbedbrowser.py @@ -291,7 +291,12 @@ class TabbedBrowser(TabWidget): @pyqtSlot(int) def on_tab_close_requested(self, idx): """Close a tab via an index.""" - self.close_tab(idx) + tab = self.widget(idx) + if tab is None: + log.webview.debug("Got invalid tab {} for index {}!".format( + tab, idx)) + return + self.close_tab(tab) @pyqtSlot(WebView) def on_window_close_requested(self, widget):