fix: check number of pages before calling hintPage

otherwise, we will reach out page limit when reached last page
This commit is contained in:
Qingping Hou
2013-01-17 20:19:58 -05:00
parent b4bad21535
commit 50e8750db4

View File

@@ -164,7 +164,13 @@ function ReaderView:onRotationUpdate(rotation)
end
function ReaderView:onHintPage()
self.ui.document:hintPage(self.state.page+1, self.state.zoom, self.state.rotation, self.render_mode)
if self.state.page < self.ui.document.info.number_of_pages then
self.ui.document:hintPage(
self.state.page+1,
self.state.zoom,
self.state.rotation,
self.render_mode)
end
return true
end