mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Fix for Crash issue when no message #61
This commit is contained in:
@@ -37,7 +37,7 @@ open class MessagesCollectionView: UICollectionView {
|
||||
private var indexPathForLastItem: IndexPath? {
|
||||
|
||||
let lastSection = numberOfSections > 0 ? numberOfSections - 1 : 0
|
||||
guard numberOfItems(inSection: lastSection) > 0 else { return nil }
|
||||
guard lastSection > 0, numberOfItems(inSection: lastSection) > 0 else { return nil }
|
||||
return IndexPath(item: numberOfItems(inSection: lastSection) - 1, section: lastSection)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user