mirror of
https://github.com/neovim/neovim.git
synced 2026-04-18 05:20:40 +00:00
fix(vim.net): check if vim.system's stdout is nil #38713
Problem: Apparently vim.SystemCompleted.stdout can also be nil, even without a custom stdout handler. (Although the docs can be interpreted otherwise). Solution: Explicitly check for nil and set the result body to an empty string if stdout was nil.
This commit is contained in:
committed by
GitHub
parent
3cba8df041
commit
398ee83f4f
@@ -87,9 +87,7 @@ function M.request(url, opts, on_response)
|
||||
err = res.stderr ~= '' and res.stderr or ('Request failed with exit code %d'):format(res.code)
|
||||
else
|
||||
if on_response then
|
||||
response = {
|
||||
body = res.stdout --[[@as string]],
|
||||
}
|
||||
response = { body = res.stdout or '' }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user