summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorYIQUN <yiqunding@zju.edu.cn>2020-11-15 21:41:58 +0800
committerGitHub <noreply@github.com>2020-11-15 08:41:58 -0500
commit0ccd69f5a9ab2e17e580a08983969f9d1ed5890b (patch)
treee3b18ca00a829c6d52160584cee76d99f8ab477b /lua
parent3c4a88efe499456452fbeea397db62b2efb35bbb (diff)
fix lsp_code_action error when no code action available (#243)
the results variable can be nil when there's no code action available, check for nil results before checking the length
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/builtin.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/telescope/builtin.lua b/lua/telescope/builtin.lua
index 30b8c90..73cf9e8 100644
--- a/lua/telescope/builtin.lua
+++ b/lua/telescope/builtin.lua
@@ -229,7 +229,7 @@ builtin.lsp_code_actions = function(opts)
local results = (results_lsp[1] or results_lsp[2]).result;
- if #results == 0 then
+ if not results or #results == 0 then
print("No code actions available")
return
end