fix crash when opening TOC window in scroll mode of EPUB
This commit is contained in:
1 parent
10db20f289
commit
720ab191ab
1 file changed
+4
-2
@@ -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