Commit 2d51946f authored by Thomas's avatar Thomas
Browse files

Fix issue #362 - Crash with notifications

parent 23ce0c4b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -421,12 +421,12 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
        }
    }

    private List<Notification> aggregateNotifications(List<Notification> notifications) {
    private List<Notification> aggregateNotifications(@NonNull List<Notification> notifications) {
        List<Notification> notificationList = new ArrayList<>();
        int refPosition = 0;
        for (int i = 0; i < notifications.size(); i++) {
            if (i != refPosition) {
                if (notifications.get(i).type.equals(notifications.get(refPosition).type)
                if (notifications.get(i).type != null && notifications.get(refPosition).type != null && notifications.get(i).type.equals(notifications.get(refPosition).type)
                        && (notifications.get(i).type.equals("favourite") || notifications.get(i).type.equals("reblog"))
                        && notifications.get(i).status != null && notifications.get(refPosition).status != null && notifications.get(i).status.id.equals(notifications.get(refPosition).status.id)
                ) {