Highlighting: avoid crash on PDF when nothing selected

Oversight in 148449df6.
This commit is contained in:
poire-z committed 2026-05-18 01:05:10 +02:00
1 parent 4104265ff4
commit 93170259b1
1 file changed
+8 -6
@@ -1810,12 +1810,14 @@ function ReaderHighlight:onHold(arg, ges)
end
return true
end
-- It has happened it failed because the text range was detected on the
-- previous page and highlighted by crengine, but no word was returned
-- (because the boxes were not on the current page).
-- Be sure we clear any such selection
self.ui.document:clearSelection()
-- And that we don't get stuck in a hold state
if self.ui.rolling then
-- It has happened it failed because the text range was detected on the
-- previous page and highlighted by crengine, but no word was returned
-- (because the boxes were not on the current page).
-- Be sure we clear any such selection
self.ui.document:clearSelection()
end
-- Be sure we don't get stuck in a hold state
self.hold_pos = nil
return false
end