🐛 Fix proto null value

This commit is contained in:
2026-02-04 03:10:18 +08:00
parent 43985b2046
commit 7f8aff20d3

View File

@@ -533,11 +533,20 @@ public class SnPaymentDetails
public string Currency { get; set; } = null!;
public string? OrderId { get; set; }
public Proto.PaymentDetails ToProtoValue() => new()
public Proto.PaymentDetails ToProtoValue()
{
Currency = Currency,
OrderId = OrderId,
};
var proto = new Proto.PaymentDetails
{
Currency = Currency
};
if (OrderId != null)
{
proto.OrderId = OrderId;
}
return proto;
}
public static SnPaymentDetails FromProtoValue(Proto.PaymentDetails proto) => new()
{