From fb2f13892506c530696cca780f0ad21b625b6afe Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 1 Jun 2025 01:19:15 +0800 Subject: [PATCH] :bug: Fix failed to push when no push subscription --- DysonNetwork.Sphere/Account/NotificationService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DysonNetwork.Sphere/Account/NotificationService.cs b/DysonNetwork.Sphere/Account/NotificationService.cs index 1766d8a..da2486c 100644 --- a/DysonNetwork.Sphere/Account/NotificationService.cs +++ b/DysonNetwork.Sphere/Account/NotificationService.cs @@ -248,9 +248,12 @@ public class NotificationService( private async Task _PushNotification(Notification notification, IEnumerable subscriptions) { + var subList = subscriptions.ToList(); + if (subList.Count == 0) return; + var requestDict = new Dictionary { - ["notifications"] = _BuildNotificationPayload(notification, subscriptions) + ["notifications"] = _BuildNotificationPayload(notification, subList) }; var client = httpFactory.CreateClient();