fix(utils): Only call callback if type(callback) == "function" (#2038)
This commit is contained in:
@@ -44,8 +44,10 @@ end
|
||||
---@param name string
|
||||
event.emit = function(self, name, ...)
|
||||
for _, callback in ipairs(self.events[name] or {}) do
|
||||
if type(callback) == "function" then
|
||||
callback(...)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return event
|
||||
|
||||
Reference in New Issue
Block a user