marinofaggiana 4 năm trước cách đây
mục cha
commit
eb4e847c3f
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      iOSClient/Media/NCMedia.swift

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -567,7 +567,7 @@ extension NCMedia: UICollectionViewDataSource {
 
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         
-        if indexPath.section < collectionView.numberOfSections && indexPath.row < collectionView.numberOfItems(inSection: indexPath.section) {
+        if indexPath.section < collectionView.numberOfSections && indexPath.row < collectionView.numberOfItems(inSection: indexPath.section) && indexPath.row < metadatas.count {
         
             let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridMediaCell
             let metadata = metadatas[indexPath.row]