From ec4e6c2493df1b3a8d381ff7a482685cb4122063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Andr=C3=A9?= Date: Fri, 1 Mar 2024 04:56:06 +0100 Subject: [PATCH] Avoid combining nil values while translating compiler messages (#40) 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) --- lua/tsc/better-messages.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/tsc/better-messages.lua b/lua/tsc/better-messages.lua index 25437c6..8fac74b 100644 --- a/lua/tsc/better-messages.lua +++ b/lua/tsc/better-messages.lua @@ -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