Marino Faggiana 7 жил өмнө
parent
commit
6dc3027d69

+ 4 - 2
iOSClient/Main/CCMain.m

@@ -5681,12 +5681,14 @@
     
     NSInteger lastSectionIndex = [self numberOfSectionsInTableView:self.tableView] - 1;
     
-    //Make sure the specified section exists
-    if (section > lastSectionIndex)
+    if (section > lastSectionIndex || lastSectionIndex < 0)
         return NO;
     
     NSInteger rowCount = [self.tableView numberOfRowsInSection:indexPath.section] - 1;
     
+    if (rowCount < 0)
+        return NO;
+    
     return row <= rowCount;
 }
 

+ 4 - 2
iOSClient/Photos/CCPhotos.m

@@ -679,12 +679,14 @@
     
     NSInteger lastSectionIndex = [self numberOfSectionsInCollectionView:self.collectionView] - 1;
     
-    //Make sure the specified section exists
-    if (section > lastSectionIndex)
+    if (section > lastSectionIndex || lastSectionIndex < 0)
         return NO;
     
     NSInteger rowCount = [self.collectionView numberOfItemsInSection:indexPath.section] - 1;
     
+    if (rowCount < 0)
+        return NO;
+    
     return row <= rowCount;
 }