Fixed The Nil Call

This commit is contained in:
Cooldude2606
2017-12-15 18:19:29 +00:00
parent 40762fc845
commit f69f92c826

View File

@@ -82,6 +82,7 @@ function inputs._event_handler(event)
element = elements[event.element.name]
end
if element then
if not is_type(element.events[event.name],'function') then return end
local success, err = pcall(element.events[event.name],event)
if not success then
if is_type(element._error,'function') then pcall(element._error)