Commit efe59af2faf24c78995da842847df9c0cd2dacb9
1 parent
342f3f57
解决滑动过程中两侧切换闪退问题
Showing
1 changed file
with
3 additions
and
1 deletions
CNLiveVideoClassifyKit/Classes/CNVideoList/Controller/CNVideoListsDetailController.m
| @@ -213,7 +213,9 @@ static NSString *const CNWitnessSearchVideoCellID = @"CNWitnessSearchVideoCell"; | @@ -213,7 +213,9 @@ static NSString *const CNWitnessSearchVideoCellID = @"CNWitnessSearchVideoCell"; | ||
| 213 | } | 213 | } |
| 214 | - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ | 214 | - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ |
| 215 | CNWitnessSearchVideoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CNWitnessSearchVideoCellID forIndexPath:indexPath]; | 215 | CNWitnessSearchVideoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CNWitnessSearchVideoCellID forIndexPath:indexPath]; |
| 216 | - cell.model = self.dataSource[indexPath.row]; | 216 | + if (self.dataSource.count > indexPath.row) { |
| 217 | + cell.model = self.dataSource[indexPath.row]; | ||
| 218 | + } | ||
| 217 | return cell; | 219 | return cell; |
| 218 | 220 | ||
| 219 | } | 221 | } |