calling an empty register function on locator will not error out

This commit is contained in:
Paul Liverman III 2018-02-11 17:16:47 -08:00
parent b32f9c9b34
commit 6c39c1cbd1

View File

@ -67,10 +67,13 @@ registry = setmetatable {}, {
if ok and register[name]
insert registered_functions, register[name]
t[name] = (...) ->
for i=1, #registered_functions-1
registered_functions[i](...)
return registered_functions[#registered_functions](...)
if #registered_functions > 0
t[name] = (...) ->
for i=1, #registered_functions-1
registered_functions[i](...)
return registered_functions[#registered_functions](...)
else
t[name] = ->
return t[name]
}