Merge pull request #742 from houqp/new_ui_houqp
bug fix: reader crashes when table of content is empty
This commit is contained in:
commit
db8872cd46
1 file changed
+1
-1
@@ -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