Roc 1 gadu atpakaļ
vecāks
revīzija
2ca5ce0c95
1 mainītis faili ar 10 papildinājumiem un 0 dzēšanām
  1. 10 0
      src/Essensoft.Paylink.WeChatPay/V3/WeChatPayClient.cs

+ 10 - 0
src/Essensoft.Paylink.WeChatPay/V3/WeChatPayClient.cs

@@ -264,6 +264,11 @@ namespace Essensoft.Paylink.WeChatPay.V3
         /// </remarks>
         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 @@ namespace Essensoft.Paylink.WeChatPay.V3
         /// </remarks>
         private static void DecryptPrivacyProperty(WeChatPayObject obj, RSA rsa)
         {
+            if(obj == null)
+            {
+                return;
+            }
+
             foreach (var propertyInfo in obj.GetType().GetProperties())
             {
                 if (propertyInfo.PropertyType == typeof(string)) // 加密字符串