From 2ca5ce0c950de21725731ce6ba522a19931d6c88 Mon Sep 17 00:00:00 2001 From: Roc Date: Mon, 15 Apr 2024 17:20:06 +0800 Subject: [PATCH] fix close#167 --- src/Essensoft.Paylink.WeChatPay/V3/WeChatPayClient.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Essensoft.Paylink.WeChatPay/V3/WeChatPayClient.cs b/src/Essensoft.Paylink.WeChatPay/V3/WeChatPayClient.cs index 83a8c6231..c075bbd1f 100644 --- a/src/Essensoft.Paylink.WeChatPay/V3/WeChatPayClient.cs +++ b/src/Essensoft.Paylink.WeChatPay/V3/WeChatPayClient.cs @@ -264,6 +264,11 @@ private async Task CheckResponseSignAsync(WeChatPayHeaders headers, string body, /// private static void EncryptPrivacyProperty(WeChatPayObject obj, RSA rsa) { + if(obj == null) + { + return; + } + foreach (var propertyInfo in obj.GetType().GetProperties()) { if (propertyInfo.PropertyType == typeof(string)) // 加密字符串 @@ -326,6 +331,11 @@ private static void EncryptPrivacyProperty(WeChatPayObject obj, RSA rsa) /// private static void DecryptPrivacyProperty(WeChatPayObject obj, RSA rsa) { + if(obj == null) + { + return; + } + foreach (var propertyInfo in obj.GetType().GetProperties()) { if (propertyInfo.PropertyType == typeof(string)) // 加密字符串