diff options
| author | Yochem van Rosmalen <git@yochem.nl> | 2026-04-05 19:11:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-05 13:11:59 -0400 |
| commit | 398ee83f4f4584322fdc67458a89b5b4c57be49c (patch) | |
| tree | 94162354a5e4318b82b758ebd8dc60bb836fc49e /runtime/lua/vim/net.lua | |
| parent | 3cba8df0412706d5803ac194bb26ba882dcd039d (diff) | |
| download | rneovim-398ee83f4f4584322fdc67458a89b5b4c57be49c.tar.gz rneovim-398ee83f4f4584322fdc67458a89b5b4c57be49c.tar.bz2 rneovim-398ee83f4f4584322fdc67458a89b5b4c57be49c.zip | |
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.
Diffstat (limited to 'runtime/lua/vim/net.lua')
| -rw-r--r-- | runtime/lua/vim/net.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/runtime/lua/vim/net.lua b/runtime/lua/vim/net.lua index acf6a44ccc..5919547be7 100644 --- a/runtime/lua/vim/net.lua +++ b/runtime/lua/vim/net.lua @@ -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 |