mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
Check for nil before checking for empty table
At least the `gopls` language server seems to return nil/null if no code actions are available. Currently this results in an error: > Error executing vim.schedule lua callback: shared.lua:199: Expected table, got nil
This commit is contained in:
parent
f559e5249e
commit
986bed2329
@ -19,7 +19,7 @@ M['workspace/executeCommand'] = function(err, _)
|
||||
end
|
||||
|
||||
M['textDocument/codeAction'] = function(_, _, actions)
|
||||
if vim.tbl_isempty(actions) then
|
||||
if actions == nil or vim.tbl_isempty(actions) then
|
||||
print("No code actions available")
|
||||
return
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user