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

Fixes #6825
This commit is contained in:
Martín Fernández
2020-10-26 12:26:18 +01:00
committed by GitHub
parent 144fd78986
commit 40b4ccffa8

View File

@@ -799,7 +799,7 @@ end
Get word and word box around `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 lb = boxes[i]
local wb = boxes[i][j]