mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix: crash when incorrect value in input page number
This commit is contained in:
committed by
Frans de Jonge
parent
b4167672fd
commit
7919026a19
@@ -295,7 +295,7 @@ function KeyValuePage:init()
|
||||
end,
|
||||
callback = function(input)
|
||||
local page = tonumber(input)
|
||||
if page >= 1 and page <= self.pages then
|
||||
if page and page >= 1 and page <= self.pages then
|
||||
self:goToPage(page)
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -445,7 +445,7 @@ function Menu:init()
|
||||
end,
|
||||
callback = function(input)
|
||||
local page = tonumber(input)
|
||||
if page >= 1 and page <= self.page_num then
|
||||
if page and page >= 1 and page <= self.page_num then
|
||||
self:onGotoPage(page)
|
||||
end
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user