Fix Github issue #695

Caused by Page.move_to_bottom() setting self.nav.page_index to -1, only
possible when there are no comments on a submission, but which also
caused a crash when rendering.
This commit is contained in:
John Helmert
2019-06-07 11:39:09 -05:00
parent de1d06e33c
commit e545c7052c

View File

@@ -236,6 +236,12 @@ class Page(object):
""" """
Move the cursor to the last item on the page. Move the cursor to the last item on the page.
""" """
# If the page is empty, don't try to go to the bottom, rtv will
# crash when rendering
if self.content.range[1] < 0:
return
self.nav.page_index = self.content.range[1] self.nav.page_index = self.content.range[1]
self.nav.cursor_index = 0 self.nav.cursor_index = 0
self.nav.inverted = True self.nav.inverted = True