Fix: crash when incorrect value in input page number
This commit is contained in:
1 parent
b4167672fd
commit
7919026a19
2 files changed
+2
-2
No files matched your search
@@ -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