mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
fix conversation screen unread count > viewItems count crash
This commit is contained in:
parent
e91469fe0e
commit
a856415438
1 changed files with 1 additions and 1 deletions
|
@ -167,7 +167,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
|||
Storage.read { transaction in
|
||||
unreadCount = self.thread.unreadMessageCount(transaction: transaction)
|
||||
}
|
||||
let clampedUnreadCount = min(unreadCount, UInt(kConversationInitialMaxRangeSize))
|
||||
let clampedUnreadCount = min(unreadCount, UInt(kConversationInitialMaxRangeSize), UInt(viewItems.endIndex))
|
||||
unreadViewItems = clampedUnreadCount != 0 ? [ConversationViewItem](viewItems[viewItems.endIndex - Int(clampedUnreadCount) ..< viewItems.endIndex]) : []
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue