avoid crash when new notification list is empty

main
Henri Gourvest 7 years ago
parent 6badc2639b
commit c4882c718f
  1. 2
      app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java

@ -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(),

Loading…
Cancel
Save