fix(lsp): fix nil client access in get_active_clients (#21524)

Fixes https://github.com/neovim/neovim/issues/21523
This commit is contained in:
Raphael 2022-12-30 23:42:18 +08:00 committed by GitHub
parent 469f985923
commit f62c30ad0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1845,7 +1845,8 @@ function lsp.get_active_clients(filter)
for client_id in pairs(t) do
local client = active_clients[client_id]
if
(filter.id == nil or client.id == filter.id)
client
and (filter.id == nil or client.id == filter.id)
and (filter.name == nil or client.name == filter.name)
then
clients[#clients + 1] = client