diff --git a/ArchiSteamFarm/ArchiHandler.cs b/ArchiSteamFarm/ArchiHandler.cs index 04851b2db..af73f08ab 100644 --- a/ArchiSteamFarm/ArchiHandler.cs +++ b/ArchiSteamFarm/ArchiHandler.cs @@ -56,11 +56,11 @@ namespace ArchiSteamFarm { internal NotificationsCallback(JobID jobID, CMsgClientUserNotifications msg) { JobID = jobID; - if (msg == null) { + if (msg == null || msg.notifications == null) { return; } - Notifications = new List(); + Notifications = new List(msg.notifications.Count); foreach (var notification in msg.notifications) { Notifications.Add(new Notification { NotificationType = (Notification.ENotificationType) notification.user_notification_type @@ -75,7 +75,7 @@ namespace ArchiSteamFarm { return; } - Notifications = new List(); + Notifications = new List(1); Notifications.Add(new Notification { NotificationType = Notification.ENotificationType.Items }); } }