Skip to content

Commit 335044e

Browse files
committed
Misc
1 parent 6a6232b commit 335044e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ArchiSteamFarm/ArchiHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ internal enum ENotificationType : uint {
5656
internal NotificationsCallback(JobID jobID, CMsgClientUserNotifications msg) {
5757
JobID = jobID;
5858

59-
if (msg == null) {
59+
if (msg == null || msg.notifications == null) {
6060
return;
6161
}
6262

63-
Notifications = new List<Notification>();
63+
Notifications = new List<Notification>(msg.notifications.Count);
6464
foreach (var notification in msg.notifications) {
6565
Notifications.Add(new Notification {
6666
NotificationType = (Notification.ENotificationType) notification.user_notification_type
@@ -75,7 +75,7 @@ internal NotificationsCallback(JobID jobID, CMsgClientItemAnnouncements msg) {
7575
return;
7676
}
7777

78-
Notifications = new List<Notification>();
78+
Notifications = new List<Notification>(1);
7979
Notifications.Add(new Notification { NotificationType = Notification.ENotificationType.Items });
8080
}
8181
}

0 commit comments

Comments
 (0)