fix(init): use rawget when loading modules to prevent possible recursive loading with invalid module fields

This commit is contained in:
Folke Lemaitre 2024-11-29 07:37:33 +01:00
parent dbb1764ae0
commit d0794dcf8e
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -25,7 +25,7 @@ setmetatable(M, {
__index = function(t, k)
---@diagnostic disable-next-line: no-unknown
t[k] = require("snacks." .. k)
return t[k]
return rawget(t, k)
end,
})