fix nil exception for langs without providers (#1290)

This commit is contained in:
Abouzar Parvan 2021-08-11 14:50:01 +04:30 committed by GitHub
parent 333b103425
commit b26b61e304
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,8 +140,10 @@ function M.setup(lang)
end
end
local lspconfig = require "lspconfig"
lspconfig[lsp.provider].setup(lsp.setup)
if lsp.provider ~= nil and lsp.provider ~= "" then
local lspconfig = require "lspconfig"
lspconfig[lsp.provider].setup(lsp.setup)
end
end
return M