fix(lsp): check for non-nil buffer state on reset (#36519)

This commit is contained in:
Maria Solano
2025-11-11 17:47:33 -08:00
committed by GitHub
parent 3606b74d24
commit 1bc85d29c1

View File

@@ -199,6 +199,9 @@ function M.reset_buf(client, bufnr)
end
assert(state.buffers, 'CTGroupState must have buffers')
local buf_state = state.buffers[bufnr]
if not buf_state then
return
end
buf_state.refs = buf_state.refs - 1
assert(buf_state.refs >= 0, 'refcount on buffer state must not get negative')
if buf_state.refs == 0 then