This commit is contained in:
JustArchi
2016-02-28 03:43:01 +01:00
parent 6a6232b655
commit 335044e38a

View File

@@ -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<Notification>();
Notifications = new List<Notification>(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<Notification>();
Notifications = new List<Notification>(1);
Notifications.Add(new Notification { NotificationType = Notification.ENotificationType.Items });
}
}