summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-04 17:02:06 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-04 17:02:06 +0800
commitea009881054fe774a59f440db8da15ce0425a464 (patch)
tree46ad5a3b1ef0f86a44c940c4efbe4650b39b1b50 /script/vm
parent6e7c082aa3e1011cdecd1761f7d04eabc0e2b8ba (diff)
downloadlua-language-server-ea009881054fe774a59f440db8da15ce0425a464.zip
fix runtime errors
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/getDocs.lua3
-rw-r--r--script/vm/guideInterface.lua2
2 files changed, 4 insertions, 1 deletions
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 790a9b50..9fd2f519 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -84,6 +84,9 @@ function vm.getDocEnums(doc, mark, results)
end
function vm.getDocTypeUnits(doc, mark, results)
+ if not doc then
+ return nil
+ end
mark = mark or {}
if mark[doc] then
return nil
diff --git a/script/vm/guideInterface.lua b/script/vm/guideInterface.lua
index 323ef76e..473d1bef 100644
--- a/script/vm/guideInterface.lua
+++ b/script/vm/guideInterface.lua
@@ -42,7 +42,7 @@ function m.require(args, index)
end
function m.dofile(args, index)
- local reqName = args[1] and args[1][1]
+ local reqName = args and args[1] and args[1][1]
if not reqName then
return
end