mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
fix(diagnostic): don't return nil when callers expect a table (#15765)
diagnostic_lines() returns a table, so make the early exit condition an empty table rather than 'nil'. This way, functions that use the input from diagnostic_lines don't have to do a bunch of defensive nil checking and can always assume they're operating on a table.
This commit is contained in:
parent
abf13258cf
commit
057606e845
@ -249,7 +249,7 @@ end
|
||||
---@private
|
||||
local function diagnostic_lines(diagnostics)
|
||||
if not diagnostics then
|
||||
return
|
||||
return {}
|
||||
end
|
||||
|
||||
local diagnostics_by_line = {}
|
||||
|
Loading…
Reference in New Issue
Block a user