summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-21 15:36:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-21 15:36:54 +0800
commit7baf51cb7879aa39d4d9b9911300e49ee34d3ace (patch)
tree71035fe1bfd5cbb2fed9bf7acd30c66b23401390
parente4588e924ae897f4b6d5d6133200a6d85dc4dfe0 (diff)
downloadlua-language-server-7baf51cb7879aa39d4d9b9911300e49ee34d3ace.zip
fix runtime error
-rw-r--r--script/vm/getDocs.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 59651ee9..4aeda446 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -11,6 +11,9 @@ local noder = require 'core.noder'
---@param name? string
---@return parser.guide.object[]
function vm.getDocDefines(uri, name)
+ if type(name) ~= 'string' then
+ return {}
+ end
local cache = vm.getCache 'getDocDefines'
if cache[name] then
return cache[name]