diff --git a/Upsilon/BaseTypes/LuaFunction.cs b/Upsilon/BaseTypes/LuaFunction.cs index f5caff8..771c9da 100644 --- a/Upsilon/BaseTypes/LuaFunction.cs +++ b/Upsilon/BaseTypes/LuaFunction.cs @@ -75,7 +75,16 @@ namespace Upsilon.BaseTypes objects.Add(null); } } - return method.Invoke(_object, objects.ToArray()).ToLuaType(); + + try + { + return method.Invoke(_object, objects.ToArray()).ToLuaType(); + } + catch (TargetInvocationException e) + { + if (e.InnerException != null) throw e.InnerException; + throw; + } } } } \ No newline at end of file