mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
koptinterface: prevent crash when word is nil (#14705)
This commit is contained in:
@@ -801,7 +801,9 @@ function KoptInterface:getReflewOCRWord(doc, pageno, rect)
|
||||
kc.getTOCRWord, kc, "dst",
|
||||
rect.x, rect.y, rect.w, rect.h,
|
||||
self.tessocr_data, self.ocr_lang, self.ocr_type, 0, 1)
|
||||
DocCache:insert(hash, CacheItem:new{ rfocrword = word, size = #word + 64 }) -- estimation
|
||||
if word then
|
||||
DocCache:insert(hash, CacheItem:new{ rfocrword = word, size = #word + 64 }) -- estimation
|
||||
end
|
||||
return word
|
||||
else
|
||||
return cached.rfocrword
|
||||
|
||||
Reference in New Issue
Block a user