mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
fix crash when opening TOC window in scroll mode of EPUB
This commit is contained in:
@@ -95,7 +95,9 @@ function ReaderToc:getTocTitleByPage(pn_or_xp)
|
||||
end
|
||||
|
||||
function ReaderToc:getTocTitleOfCurrentPage()
|
||||
return self:getTocTitleByPage(self.pageno)
|
||||
if self.pageno then
|
||||
return self:getTocTitleByPage(self.pageno)
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderToc:getMaxDepth()
|
||||
@@ -220,7 +222,7 @@ function ReaderToc:getChapterPagesDone(pageno, level)
|
||||
end
|
||||
|
||||
function ReaderToc:updateCurrentNode()
|
||||
if #self.collapsed_toc > 0 then
|
||||
if #self.collapsed_toc > 0 and self.pageno then
|
||||
for i, v in ipairs(self.collapsed_toc) do
|
||||
if v.page > self.pageno then
|
||||
self.collapsed_toc.current = i > 1 and i - 1 or 1
|
||||
|
||||
Reference in New Issue
Block a user