From 1deeb87b6816e966115713952078b3a9277e6387 Mon Sep 17 00:00:00 2001 From: IguanaCucumber Date: Sun, 23 Feb 2025 15:16:18 +0000 Subject: [PATCH] fix(utils): Only call callback if type(callback) == "function" (#2038) --- lua/cmp/utils/event.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/cmp/utils/event.lua b/lua/cmp/utils/event.lua index 662d573..1580364 100644 --- a/lua/cmp/utils/event.lua +++ b/lua/cmp/utils/event.lua @@ -44,7 +44,9 @@ end ---@param name string event.emit = function(self, name, ...) for _, callback in ipairs(self.events[name] or {}) do - callback(...) + if type(callback) == "function" then + callback(...) + end end end