mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -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
|
end
|
||||||
|
|
||||||
M['textDocument/codeAction'] = function(_, _, actions)
|
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")
|
print("No code actions available")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user