Handle nil result in pull diagnostic handler (#5147)

- A stale or cancelled textDocument/diagnostic request can be answered
  with a nil result and no error, which is valid per the LSP
  specification. Guard against it so the handler does nothing rather
  than indexing the nil result.
This commit is contained in:
Paul Johnson authored and GitHub committed 2026-07-25 22:21:28 +09:00
1 parent d0ea943232
commit 5fab9dec37
2 files changed
+28 -1

No files matched your search

+1 -1
View File
@@ -77,7 +77,7 @@ module.start = function(config)
end,
-- Handle pull model diagnostic data.
["textDocument/diagnostic"] = function(err, result, request, _)
if err == nil then
if err == nil and result ~= nil then
local diagnostics
if result.kind == "unchanged" then