use pcall when calling get_node function, since it can raise an error in some cases. (#425)

This commit is contained in:
Cameron
2025-12-31 23:46:01 +01:00
committed by GitHub
parent e9336fa1a9
commit 0fb1e6b7ce

View File

@@ -40,8 +40,8 @@ function M.lang_skip(lnum, col)
return false
end
local node = vts.get_node({pos = {lnum - 1, col - 1}})
if not node then
local success, node = pcall(vts.get_node, {pos = {lnum - 1, col - 1}})
if not success or not node then
return false
end
---@diagnostic disable-next-line: missing-fields LuaLS bug