koptinterface: prevent crash when word is nil (#14705)

This commit is contained in:
hius07
2025-12-10 14:18:33 +02:00
committed by GitHub
parent 5b2f2cbdb3
commit f8175e34a4

View File

@@ -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