Merge pull request #112 from mattrose/fix-closewindow-1

fix traceback when closing a window
This commit is contained in:
Matt Rose 2020-06-10 21:44:16 -04:00 committed by GitHub
commit 3e73e89765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1230,7 +1230,11 @@ class Terminal(Gtk.VBox):
def ensure_visible_and_focussed(self):
"""Make sure that we're visible and focussed"""
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()
if maker.isinstance(topchild, 'Notebook'):