mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-01 19:13:03 +08:00
Fix evaluate exception logic with methods that have arguments
This commit is contained in:
@ -30,15 +30,14 @@ namespace UnityExplorer.CacheObject
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var methodInfo = MethodInfo;
|
var methodInfo = MethodInfo;
|
||||||
|
|
||||||
if (methodInfo.IsGenericMethod)
|
if (methodInfo.IsGenericMethod)
|
||||||
methodInfo = MethodInfo.MakeGenericMethod(Evaluator.TryParseGenericArguments());
|
methodInfo = MethodInfo.MakeGenericMethod(Evaluator.TryParseGenericArguments());
|
||||||
|
|
||||||
if (Arguments.Length > 0)
|
object ret;
|
||||||
return methodInfo.Invoke(DeclaringInstance, Evaluator.TryParseArguments());
|
if (HasArguments)
|
||||||
|
ret = methodInfo.Invoke(DeclaringInstance, Evaluator.TryParseArguments());
|
||||||
var ret = methodInfo.Invoke(DeclaringInstance, ArgumentUtility.EmptyArgs);
|
else
|
||||||
|
ret = methodInfo.Invoke(DeclaringInstance, ArgumentUtility.EmptyArgs);
|
||||||
HadException = false;
|
HadException = false;
|
||||||
LastException = null;
|
LastException = null;
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user