From b91403bef68979fe5825d12d4c736bb11e3e8453 Mon Sep 17 00:00:00 2001 From: oneRain Date: Thu, 29 Apr 2021 15:56:52 +0800 Subject: [PATCH] fix: cloud function no params. --- Storage/Storage/Public/LCCloud.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Storage/Storage/Public/LCCloud.cs b/Storage/Storage/Public/LCCloud.cs index 3fbe1ba..3f7ec40 100644 --- a/Storage/Storage/Public/LCCloud.cs +++ b/Storage/Storage/Public/LCCloud.cs @@ -30,7 +30,7 @@ namespace LeanCloud.Storage { Dictionary headers = new Dictionary { { PRODUCTION_KEY, IsProduction ? 1 : 0 } }; - object encodeParams = LCEncoder.Encode(parameters); + object encodeParams = LCEncoder.Encode(parameters ?? new Dictionary()); Dictionary response = await LCCore.HttpClient.Post>(path, headers: headers, data: encodeParams); @@ -59,7 +59,8 @@ namespace LeanCloud.Storage { /// Cloud function name. /// Parameters of cloud function. /// LCObject, List, or Map. - public static async Task RPC(string name, object parameters = null) { + public static async Task RPC(string name, + object parameters = null) { string path = $"call/{name}"; Dictionary headers = new Dictionary { { PRODUCTION_KEY, IsProduction ? 1 : 0 }