KoptInterface: prevent crash when word is nil

This commit is contained in:
Frans de Jonge committed 2025-09-15 19:49:11 +02:00
1 parent e5dca93eba
commit d2d39c503d
1 file changed
+3 -1
+3 -1
View File
@@ -833,7 +833,9 @@ function KoptInterface:getNativeOCRWord(doc, pageno, rect)
kc.getTOCRWord, kc, "src",
0, 0, word_w, word_h,
self.tessocr_data, self.ocr_lang, self.ocr_type, 0, 1)
DocCache:insert(hash, CacheItem:new{ ocrword = word, size = #word + 64 }) -- estimation
if word then
DocCache:insert(hash, CacheItem:new{ ocrword = word, size = #word + 64 }) -- estimation
end
logger.dbg("word", word)
page:close()
kc:free()