From c4882c718ffb04f1ddc5ebbd8262cd35066b027b Mon Sep 17 00:00:00 2001 From: Henri Gourvest Date: Fri, 14 Jul 2017 11:11:38 +0200 Subject: [PATCH] avoid crash when new notification list is empty --- .../com/keylesspalace/tusky/fragment/NotificationsFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index 1471403b..18aa1875 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/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 newViewDatas = notifications.getPairedCopy() .subList(notifications.size() - newNotifications.size(),