From 9cde1e5891b6d935dd47c12be8c3c89e00d2e1e8 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Thu, 23 Sep 2021 10:52:21 -0600 Subject: fix(diagnostic): check for nil in show_diagnostics (#15772) --- runtime/lua/vim/diagnostic.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 0539da676e..3f41ee5df8 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -379,7 +379,7 @@ end ---@param diagnostics table: The diagnostics to display ---@return table {popup_bufnr, win_id} local function show_diagnostics(opts, diagnostics) - if vim.tbl_isempty(diagnostics) then + if not diagnostics or vim.tbl_isempty(diagnostics) then return end local lines = {} -- cgit