소스 검색

check valid indexpath

marinofaggiana 6 년 전
부모
커밋
985da46a07
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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
         }