fix(plugin): check that import is a string. See #825

This commit is contained in:
Folke Lemaitre 2023-05-25 08:25:34 +02:00
parent 721e37b4dd
commit c325c50ba4
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 0 deletions

View File

@ -265,6 +265,9 @@ function Spec:import(spec)
if spec.import == "lazy" then if spec.import == "lazy" then
return self:error("You can't name your plugins module `lazy`.") return self:error("You can't name your plugins module `lazy`.")
end end
if type(spec.import) ~= "string" then
return self:error("Invalid import spec. `import` should be a string: " .. vim.inspect(spec))
end
if vim.tbl_contains(self.modules, spec.import) then if vim.tbl_contains(self.modules, spec.import) then
return return
end end