mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix intermittent crash
// FREEBIE
This commit is contained in:
parent
6db5895269
commit
a01de44917
|
@ -281,9 +281,14 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
|
|||
}
|
||||
|
||||
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCellReuseIdentifier, for: indexPath)
|
||||
|
||||
guard indexPath.row < imageInfos.count else {
|
||||
Logger.warn("\(TAG) indexPath: \(indexPath.row) out of range for imageInfo count: \(imageInfos.count) ")
|
||||
return cell
|
||||
}
|
||||
let imageInfo = imageInfos[indexPath.row]
|
||||
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCellReuseIdentifier, for: indexPath)
|
||||
guard let gifCell = cell as? GifPickerCell else {
|
||||
owsFail("\(TAG) Unexpected cell type.")
|
||||
return cell
|
||||
|
|
Loading…
Reference in a new issue