Don't try to set focus if prev_focus is None

This commit is contained in:
Florian Bruhin 2018-06-21 01:44:15 +02:00
parent e7a300865c
commit 9f5ca475c9

View File

@ -506,7 +506,8 @@ class TabbedBrowser(QWidget):
usertypes.KeyMode.yesno]:
# If we were in a command prompt, restore old focus
# The above commands need to be run to switch tabs
prev_focus.setFocus()
if prev_focus is not None:
prev_focus.setFocus()
tab.show()
self.new_tab.emit(tab, idx)