Check if currentWidget is None in tabbed_browser.on_mode_left.

Fixes #186.
This commit is contained in:
Florian Bruhin 2014-10-14 17:50:50 +02:00
parent 6d2111bcd4
commit 1c551975c4

View File

@ -496,7 +496,10 @@ class TabbedBrowser(tabwidget.TabWidget):
def on_mode_left(self, mode):
"""Give focus to current tab if command mode was left."""
if mode == usertypes.KeyMode.command:
self.currentWidget().setFocus()
widget = self.currentWidget()
if widget is None:
return
widget.setFocus()
@pyqtSlot(int)
def on_current_changed(self, idx):