Skip to content

Commit 0bef68a

Browse files
author
Jose Alvarez
committed
fix(helpers): handle vim.NIL json return value
1 parent daed6db commit 0bef68a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/null-ls/helpers.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
local u = require("null-ls.utils")
22
local loop = require("null-ls.loop")
3-
local methods = require("null-ls.methods")
43

54
local validate = vim.validate
65

@@ -17,6 +16,7 @@ end
1716
local json_output_wrapper = function(params, done, on_output)
1817
local ok, decoded = pcall(vim.fn.json_decode, params.output)
1918
if not ok then error("failed to decode json: " .. decoded) end
19+
if decoded == vim.NIL then decoded = nil end
2020

2121
params.output = decoded
2222
done(on_output(params))

0 commit comments

Comments
 (0)