From 7f8aff20d356bc60950e41661dffe8985c52b958 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 4 Feb 2026 03:10:18 +0800 Subject: [PATCH] :bug: Fix proto null value --- DysonNetwork.Shared/Models/Subscription.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/DysonNetwork.Shared/Models/Subscription.cs b/DysonNetwork.Shared/Models/Subscription.cs index 75aa0703..ee54d53e 100644 --- a/DysonNetwork.Shared/Models/Subscription.cs +++ b/DysonNetwork.Shared/Models/Subscription.cs @@ -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() {