Merge pull request #336 from hgourvest/master
avoid crash when new notification list is empty
This commit is contained in:
commit
92c24fbd1d
1 changed files with 1 additions and 1 deletions
|
@ -463,7 +463,7 @@ public class NotificationsFragment extends SFragment implements
|
||||||
}
|
}
|
||||||
int end = notifications.size();
|
int end = notifications.size();
|
||||||
Notification last = notifications.get(end - 1);
|
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);
|
notifications.addAll(newNotifications);
|
||||||
List<NotificationViewData> newViewDatas = notifications.getPairedCopy()
|
List<NotificationViewData> newViewDatas = notifications.getPairedCopy()
|
||||||
.subList(notifications.size() - newNotifications.size(),
|
.subList(notifications.size() - newNotifications.size(),
|
||||||
|
|
Loading…
Reference in a new issue