Skip to content

Commit e6ea632

Browse files
authored
fix(angularls): handle nil #3594
Problem: Warning message while opening a directory without node_modules. Solution: Handle nil.
1 parent 9962e25 commit e6ea632

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/lspconfig/configs/angularls.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ end
1212
local function get_angular_core_version(root_dir)
1313
local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])
1414

15+
if not project_root then
16+
return ''
17+
end
18+
1519
local package_json = project_root .. '/package.json'
1620
if not vim.loop.fs_stat(package_json) then
1721
return ''

0 commit comments

Comments
 (0)