Prevent exception when exiting while waiting for scroll

ft.font-size^2
Gonçalo Silva 2019-04-16 01:15:11 +01:00
parent 41377c24bb
commit c9958b6c12
1 changed files with 2 additions and 0 deletions

View File

@ -161,6 +161,8 @@ class TextView(Gtk.TextView):
margin = 80
scrolled_window = self.get_ancestor(Gtk.ScrolledWindow.__gtype__)
if not scrolled_window:
return
va = scrolled_window.get_vadjustment()
if va.props.page_size < margin * 2:
return