marinofaggiana преди 4 години
родител
ревизия
eb4e847c3f
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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]