summaryrefslogtreecommitdiff
path: root/script-beta/jsonrpc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-30 16:30:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-30 16:30:08 +0800
commitf216f27c985625634d5ef337fc266c0f7682aa08 (patch)
treea6dc49132e98cf41075dd193b737032033c8bff2 /script-beta/jsonrpc.lua
parentaca5d65499c3af0fe0d73cd7ce69e7de2248b1e8 (diff)
downloadlua-language-server-f216f27c985625634d5ef337fc266c0f7682aa08.zip
fix #238 json.decode 时,将 null 解析为 nil
Diffstat (limited to 'script-beta/jsonrpc.lua')
-rw-r--r--script-beta/jsonrpc.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script-beta/jsonrpc.lua b/script-beta/jsonrpc.lua
index 4dda6fb0..5957588f 100644
--- a/script-beta/jsonrpc.lua
+++ b/script-beta/jsonrpc.lua
@@ -49,7 +49,10 @@ function m.decode(reader, errHandle)
if not content then
return nil
end
+ local null = json.null
+ json.null = nil
local suc, res = pcall(json.decode, content)
+ json.null = null
if not suc then
errHandle('Proto parse error: ' .. res)
return nil