mirror of https://github.com/folke/lazy.nvim.git
fix(core): validate non-string plugin
This commit is contained in:
parent
cf8ecc2c5e
commit
5b9ec99fe4
|
@ -106,6 +106,9 @@ function M:add(plugin)
|
||||||
|
|
||||||
-- short url / ref
|
-- short url / ref
|
||||||
if plugin[1] then
|
if plugin[1] then
|
||||||
|
if type(plugin[1]) ~= "string" then
|
||||||
|
return self.spec:error("Invalid plugin spec " .. vim.inspect(plugin))
|
||||||
|
end
|
||||||
local slash = plugin[1]:find("/", 1, true)
|
local slash = plugin[1]:find("/", 1, true)
|
||||||
if slash then
|
if slash then
|
||||||
local prefix = plugin[1]:sub(1, 4)
|
local prefix = plugin[1]:sub(1, 4)
|
||||||
|
|
Loading…
Reference in New Issue