Skip to content

Commit

Permalink
fix: check if loader returned a function before loading
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 1, 2022
1 parent e287447 commit 66946c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/noice/util/hacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function M.on_module(module, fn)
for l, loader in pairs(package.loaders) do
if l > 1 then
local ret = loader(module)
if ret then
if type(ret) == "function" then
local mod = ret()
fn(mod)
return mod
Expand Down

0 comments on commit 66946c7

Please sign in to comment.