fix(tenpayv3): 修复部分场景下 RSA 加密请求敏感信息字段错误的问题

This commit is contained in:
Fu Diwei
2021-11-26 01:43:43 +08:00
parent a673044479
commit a006582c49
2 changed files with 7 additions and 2 deletions

View File

@@ -120,7 +120,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Utilities
Type propType = childProp.PropertyType;
if (propType == typeof(string))
{
string oldValue = (string)childProp.GetValue(obj, null)!;
object? value = childProp.GetValue(obj, null);
if (value is null)
continue;
string oldValue = (string)value!;
string newValue = replacement(obj, childProp, oldValue);
childProp.SetValue(obj, newValue);
}