protected call in ref
This commit is contained in:
parent
49745927e4
commit
21cb8e23e1
|
@ -497,7 +497,11 @@ function ref(n) -- ref object by name
|
||||||
return n;
|
return n;
|
||||||
end
|
end
|
||||||
if type(n) == 'function' then
|
if type(n) == 'function' then
|
||||||
return ref(n());
|
local r,v = pcall(n);
|
||||||
|
if not r then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
return ref(v);
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue