mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #742 from houqp/new_ui_houqp
bug fix: reader crashes when table of content is empty
This commit is contained in:
@@ -71,7 +71,7 @@ function ReaderToc:onShowToc()
|
||||
self:fillToc()
|
||||
end
|
||||
-- build menu items
|
||||
if self.toc and not self.toc[1].text then
|
||||
if #self.toc > 0 and not self.toc[1].text then
|
||||
for _,v in ipairs(self.toc) do
|
||||
v.text = (" "):rep(v.depth-1)..self:cleanUpTocTitle(v.title)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user