Explorar o código

check valid indexpath

marinofaggiana %!s(int64=6) %!d(string=hai) anos
pai
achega
985da46a07
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      iOSClient/Media/NCMedia.swift

+ 4 - 1
iOSClient/Media/NCMedia.swift

@@ -368,7 +368,10 @@ extension NCMedia: UICollectionViewDelegate {
             } else {
                 selectFileID.append(metadata.fileID)
             }
-            collectionView.reloadItems(at: [indexPath])
+            if indexPath.section <  collectionView.numberOfSections && indexPath.row < collectionView.numberOfItems(inSection: indexPath.section) {
+                collectionView.reloadItems(at: [indexPath])
+            }
+            
             return
         }