From 4e41e4c907c8f90ce8871ed1ba488f4a5bb6da28 Mon Sep 17 00:00:00 2001 From: Furkan Aydin Date: Wed, 12 Nov 2025 07:35:26 +0300 Subject: fix(angularls): add nil check for config parameter #4181 The cmd function's config parameter can sometimes be nil, causing a warning when attempting to access config.root. Added a nil check to safely handle this case. Fixes #4180 --- lsp/angularls.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lsp/angularls.lua') diff --git a/lsp/angularls.lua b/lsp/angularls.lua index a5a94c6e..474905d7 100644 --- a/lsp/angularls.lua +++ b/lsp/angularls.lua @@ -66,7 +66,7 @@ end ---@type vim.lsp.Config return { cmd = function(dispatchers, config) - local root_dir = config.root or fn.getcwd() + local root_dir = (config and config.root) or fn.getcwd() local node_paths = collect_node_modules(root_dir) local ts_probe = table.concat(node_paths, ',')