From 0a28cdf9d6f03b86f55a95854fcd2f29a468d476 Mon Sep 17 00:00:00 2001 From: Alexey Svirschevskiy Date: Wed, 26 Jan 2022 19:15:42 +0100 Subject: fix(lsp): avoid accessing undefined user_data (#2216) Co-authored-by: Alexey Svirshchevskiy --- lua/lvim/lsp/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/lvim/lsp/config.lua b/lua/lvim/lsp/config.lua index fb59ca51..3d62461d 100644 --- a/lua/lvim/lsp/config.lua +++ b/lua/lvim/lsp/config.lua @@ -23,7 +23,7 @@ return { prefix = "", format = function(d) local t = vim.deepcopy(d) - local code = d.code or d.user_data.lsp.code + local code = d.code or (d.user_data and d.user_data.lsp.code) if code then t.message = string.format("%s [%s]", t.message, code):gsub("1. ", "") end -- cgit v1.2.3