From 367c57b00f670760de565a915d1f19d3483f001a Mon Sep 17 00:00:00 2001 From: oneRain Date: Mon, 22 Mar 2021 17:21:04 +0800 Subject: [PATCH] chore: support no parameter. --- Engine/LCEngine.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Engine/LCEngine.cs b/Engine/LCEngine.cs index 595a777..301cf2f 100644 --- a/Engine/LCEngine.cs +++ b/Engine/LCEngine.cs @@ -204,7 +204,10 @@ namespace LeanCloud.Engine { internal static async Task Invoke(MethodInfo mi, object request) { try { - object[] ps = new object[] { request }; + object[] ps = null; + if (mi.GetParameters().Length > 0) { + ps = new object[] { request }; + } if (mi.ReturnType == typeof(Task) || (mi.ReturnType.IsGenericType && mi.ReturnType.GetGenericTypeDefinition() == typeof(Task<>))) { Task task = mi.Invoke(null, ps) as Task;