From 40b4ccffa88144ecf3244f0612c447a364cc913d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= Date: Mon, 26 Oct 2020 12:26:18 +0100 Subject: [PATCH] KoptInterface:getWordFromBoxes: guard against nil boxes (#6827) Fixes #6825 --- frontend/document/koptinterface.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]