mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix rare bugs identified by fuzzing
This commit is contained in:
@@ -34,7 +34,7 @@ function ReaderDictionary:stardictLookup(word, box)
|
||||
end
|
||||
|
||||
function ReaderDictionary:showDict(results, box)
|
||||
if results and results[1] then
|
||||
if results and results[1] and box then
|
||||
DEBUG("showing quick lookup dictionary window")
|
||||
local align = nil
|
||||
local region = Geom:new{x = 0, w = Screen:getWidth()}
|
||||
|
||||
@@ -77,6 +77,7 @@ function ReaderFooter:init()
|
||||
end
|
||||
|
||||
function ReaderFooter:updateFooter()
|
||||
if type(self.pageno) ~= "number" then return end
|
||||
self.progress_bar.percentage = self.pageno / self.pages
|
||||
if self.show_time then
|
||||
self.progress_text.text = os.date("%H:%M")
|
||||
|
||||
@@ -53,9 +53,11 @@ end
|
||||
function ReaderLink:onTap(arg, ges)
|
||||
if self.ui.document.info.has_pages then
|
||||
local pos = self.view:screenToPageTransform(ges.pos)
|
||||
local link = self.ui.document:getLinkFromPosition(pos.page, pos)
|
||||
if link then
|
||||
return self:onGotoLink(link)
|
||||
if pos then
|
||||
local link = self.ui.document:getLinkFromPosition(pos.page, pos)
|
||||
if link then
|
||||
return self:onGotoLink(link)
|
||||
end
|
||||
end
|
||||
else
|
||||
local link = self.ui.document:getLinkFromPosition(ges.pos)
|
||||
|
||||
Reference in New Issue
Block a user