Skip to content

Commit

Permalink
Avoid combining nil values while translating compiler messages (#40)
Browse files Browse the repository at this point in the history
This patch will handle the following error message by checking the
`body` value before using it.

> tsc.nvim/lua/tsc/better-messages.lua:101: attempt to concatenate field 'body' (a nil value)
  • Loading branch information
marcusandre authored Mar 1, 2024
1 parent 4151f82 commit ec4e6c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/tsc/better-messages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ M.translate = function(message)

local params = get_params(parsed["original"])

if #params == 0 then
if #params == 0 and parsed.body then
return "TS" .. error_num .. ": " .. parsed.body
end

Expand Down

0 comments on commit ec4e6c2

Please sign in to comment.