mirror of
https://github.com/dense-analysis/ale.git
synced 2026-10-02 08:23:44 +08:00
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:
1 parent
d0ea943232
commit
5fab9dec37
2 files changed
+28
-1
No files matched your search
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user