From 234f5eb02294c7bce50ec7a0153b470d7598bed4 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 9 Mar 2021 09:07:52 +1100 Subject: [PATCH] Quick fix crash --- Session/Conversations/ConversationVC.swift | 1 - Session/Conversations/ConversationViewModel.m | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 932e0e0c0b..4f8a69a17a 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -148,7 +148,6 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat Storage.read { transaction in unreadCount = self.thread.unreadMessageCount(transaction: transaction) } - // FIXME: This crashes when you have more unread messages than loaded view items (viewItems is initially capped to kConversationInitialMaxRangeSize) unreadViewItems = unreadCount != 0 ? [ConversationViewItem](viewItems[viewItems.endIndex - Int(unreadCount) ..< viewItems.endIndex]) : [] } diff --git a/Session/Conversations/ConversationViewModel.m b/Session/Conversations/ConversationViewModel.m index d0ba8f3e77..cee8ff67ec 100644 --- a/Session/Conversations/ConversationViewModel.m +++ b/Session/Conversations/ConversationViewModel.m @@ -173,7 +173,7 @@ + (ConversationUpdate *)diffUpdateWithUpdateItems:(nullable NSArray