Fix crash in readertoc.lua

This issue has been mentioned in https://github.com/koreader/koreader/issues/2186.
pull/2200/head
Hzj_jie 8 years ago committed by GitHub
parent c67dc8d9b7
commit 3df363165a

@ -333,7 +333,7 @@ function ReaderToc:onShowToc()
function toc_menu:onMenuSelect(item, pos)
-- if toc item has expand/collapse state and tap select on the left side
-- the state switch action is triggered, otherwise goto the linked page
if item.state and pos.x < 0.3 then
if item.state and pos and pos.x < 0.3 then
item.state.callback()
else
toc_menu:close_callback()

Loading…
Cancel
Save