summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-22 17:17:09 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-22 17:17:09 +0800
commit98566b1ccbbea4c87a669e9dd0b7afa978aeeaa8 (patch)
tree5c77f63660419b1fcfd8cd8e7c252f802437cfab
parentf416c7feda70c1ab0332a07967e0f00eeebe092a (diff)
downloadlua-language-server-98566b1ccbbea4c87a669e9dd0b7afa978aeeaa8.zip
check nil
-rw-r--r--script/utility.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script/utility.lua b/script/utility.lua
index 66beaf07..7f9d559b 100644
--- a/script/utility.lua
+++ b/script/utility.lua
@@ -290,6 +290,9 @@ function m.loadFile(path, keepBom)
end
local text = f:read 'a'
f:close()
+ if not text then
+ return nil
+ end
if not keepBom then
if text:sub(1, 3) == '\xEF\xBB\xBF' then
return text:sub(4)