summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/completion.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index 347b1186..d27a32c5 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -66,6 +66,9 @@ local function findNearestTableField(state, position)
local text = files.getText(uri)
local offset = guide.positionToOffset(state, position)
local soffset = lookBackward.findAnyOffset(text, offset - 1)
+ if not soffset then
+ return nil
+ end
local symbol = text:sub(soffset, soffset)
if symbol == '}' then
return nil