From 902d6aa31450d26e11bedcbef8af5b6fe2e1ffe8 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 31 Jan 2023 19:01:36 +0800 Subject: fix: check client when get client from cache (#2429) --- lua/lspconfig/util.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 86483731..698cd2d9 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -245,7 +245,7 @@ function M.server_per_root_dir_manager(make_config) if clients[root_dir] then for _, id in pairs(clients[root_dir]) do local client = lsp.get_client_by_id(id) - if client.name == client_name then + if client and client.name == client_name then return client end end @@ -258,7 +258,7 @@ function M.server_per_root_dir_manager(make_config) for _, id in ipairs(all_client_ids) do local client = lsp.get_client_by_id(id) - if client.name == client_name then + if client and client.name == client_name then return client end end -- cgit v1.2.3-70-g09d2