[Backport release-0.8] fix(lsp): check active_clients table length first (#21593)

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Raphael <glephunter@gmail.com>
This commit is contained in:
github-actions[bot]
2022-12-31 13:22:03 +01:00
committed by GitHub
parent 056b24445f
commit 8bbed45e10

View File

@ -1792,7 +1792,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