diff --git a/frontend/document/koptinterface.lua b/frontend/document/koptinterface.lua index 7049af3f4..863a18c8e 100644 --- a/frontend/document/koptinterface.lua +++ b/frontend/document/koptinterface.lua @@ -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]