ReaderPaging:onRestoreBookLocation Do not restore nil location

it can pe passed a nil / empty table if the location stack is empty, return early in this case.

Fixes: #12869
This commit is contained in:
yparitcher
2025-04-16 12:30:11 -04:00
parent f4a385a6be
commit 92de0759ed

View File

@@ -596,6 +596,9 @@ function ReaderPaging:getBookLocation()
end
function ReaderPaging:onRestoreBookLocation(saved_location)
if not saved_location or not saved_location[1] then
return
end
if self.view.page_scroll then
if self.view:restoreViewContext(saved_location) then
self:_gotoPage(saved_location[1].page, "scrolling")