From 3df363165a3cf70f1e646f9f6a7da5d140d113a3 Mon Sep 17 00:00:00 2001 From: Hzj_jie Date: Fri, 29 Jul 2016 22:47:44 -0700 Subject: [PATCH] Fix crash in readertoc.lua This issue has been mentioned in https://github.com/koreader/koreader/issues/2186. --- frontend/apps/reader/modules/readertoc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/apps/reader/modules/readertoc.lua b/frontend/apps/reader/modules/readertoc.lua index a9011e147..ea94e7414 100644 --- a/frontend/apps/reader/modules/readertoc.lua +++ b/frontend/apps/reader/modules/readertoc.lua @@ -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()