avoid crash when new notification list is empty

This commit is contained in:
Henri Gourvest 2017-07-14 11:11:38 +02:00
parent 38db48c7cb
commit 0945b881f5
1 changed files with 1 additions and 1 deletions

View File

@ -463,7 +463,7 @@ public class NotificationsFragment extends SFragment implements
}
int end = notifications.size();
Notification last = notifications.get(end - 1);
if (last != null && !findNotification(newNotifications, last.id)) {
if (last != null && !findNotification(newNotifications, last.id) && newNotifications.size() > 0) {
notifications.addAll(newNotifications);
List<NotificationViewData> newViewDatas = notifications.getPairedCopy()
.subList(notifications.size() - newNotifications.size(),