widgets.tabbedbrowser: Fix closing tab with mouse.

This commit is contained in:
Florian Bruhin 2014-08-01 14:27:57 +02:00
parent b6cd0dd600
commit 6015bed786

View File

@ -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):