From 316107a1cb5111d266d0b5b717cc6dcbc2851eea Mon Sep 17 00:00:00 2001 From: poire-z Date: Thu, 4 Feb 2021 21:32:42 +0100 Subject: [PATCH] ReaderRolling: fix possible crash in scroll mode When opening a document in scroll mode with an invalid last_xpointer. This code path was never taken before 05126b94, and it has never been updated to pass the page number in scroll mode (so it's provided to the footer) like it has been in other places. --- frontend/apps/reader/modules/readerrolling.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/apps/reader/modules/readerrolling.lua b/frontend/apps/reader/modules/readerrolling.lua index b7f05ffe8..b5ba67a3f 100644 --- a/frontend/apps/reader/modules/readerrolling.lua +++ b/frontend/apps/reader/modules/readerrolling.lua @@ -891,7 +891,7 @@ function ReaderRolling:onRedrawCurrentView() if self.view.view_mode == "page" then self.ui:handleEvent(Event:new("PageUpdate", self.current_page)) else - self.ui:handleEvent(Event:new("PosUpdate", self.current_pos)) + self.ui:handleEvent(Event:new("PosUpdate", self.current_pos, self.ui.document:getCurrentPage())) end return true end