KoptInterface:getWordFromBoxes: guard against nil boxes (#6827)

Fixes #6825
reviewable/pr6837/r1
Martín Fernández 4 years ago committed by GitHub
parent 144fd78986
commit 40b4ccffa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -799,7 +799,7 @@ end
Get word and word box around `pos`. Get word and word box around `pos`.
--]] --]]
function KoptInterface:getWordFromBoxes(boxes, pos) function KoptInterface:getWordFromBoxes(boxes, pos)
if not pos or #boxes == 0 then return {} end if not pos or not boxes or #boxes == 0 then return {} end
local i, j = getWordBoxIndices(boxes, pos) local i, j = getWordBoxIndices(boxes, pos)
local lb = boxes[i] local lb = boxes[i]
local wb = boxes[i][j] local wb = boxes[i][j]

Loading…
Cancel
Save