fix traceback when closing a window

This commit is contained in:
Matt Rose 2020-06-02 15:46:15 -04:00
parent 9d5c2a6bb3
commit 32be225258
1 changed files with 5 additions and 1 deletions

View File

@ -1226,7 +1226,11 @@ class Terminal(Gtk.VBox):
def ensure_visible_and_focussed(self): def ensure_visible_and_focussed(self):
"""Make sure that we're visible and focussed""" """Make sure that we're visible and focussed"""
window = self.get_toplevel() window = self.get_toplevel()
topchild = window.get_children()[0] try:
topchild = window.get_children()[0]
except IndexError:
dbg('unable to get top child')
return
maker = Factory() maker = Factory()
if maker.isinstance(topchild, 'Notebook'): if maker.isinstance(topchild, 'Notebook'):