summaryrefslogtreecommitdiff
path: root/script/parser/guide.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-04 16:04:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-04 16:04:19 +0800
commite4fba94f2586e5b2ed41b2a57ae5d4b7adc469b1 (patch)
tree7ba2d5e74cc0b49ad1ad5f5aa7a64359312f7569 /script/parser/guide.lua
parent9bf48f39f9c7e8ff2b1ae6b74237c6e601158df2 (diff)
downloadlua-language-server-e4fba94f2586e5b2ed41b2a57ae5d4b7adc469b1.zip
check nil
Diffstat (limited to 'script/parser/guide.lua')
-rw-r--r--script/parser/guide.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index eda85c97..e7b19bd3 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -803,6 +803,9 @@ function m.offsetToPosition(state, offset)
end
function m.getLineRange(state, row)
+ if not state.lines[row] then
+ return 0
+ end
local nextLineStart = state.lines[row + 1] or #state.lua
for i = nextLineStart - 1, state.lines[row], -1 do
local w = state.lua:sub(i, i)