From 66946c72f0a36f37e480b5eae97aac3cdcd5961d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 1 Dec 2022 23:51:21 +0100 Subject: [PATCH] fix: check if loader returned a function before loading --- lua/noice/util/hacks.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/noice/util/hacks.lua b/lua/noice/util/hacks.lua index 93cd351..40ab36b 100644 --- a/lua/noice/util/hacks.lua +++ b/lua/noice/util/hacks.lua @@ -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