mirror of
https://github.com/neovim/neovim.git
synced 2026-04-14 03:26:10 +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.
(cherry picked from commit 398ee83f4f)
This commit is contained in:
committed by
github-actions[bot]
parent
fdf94493cf
commit
e7a07364ad
@@ -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