From c325c50ba42572b25c08330ea10ae4743ee69280 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 25 May 2023 08:25:34 +0200 Subject: [PATCH] fix(plugin): check that import is a string. See #825 --- lua/lazy/core/plugin.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index c53ee72..eb132d3 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -265,6 +265,9 @@ function Spec:import(spec) if spec.import == "lazy" then return self:error("You can't name your plugins module `lazy`.") 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 return end