Sfoglia il codice sorgente

1.修改Homer Model Detail Image Count为0时点击Crash。

Pen Li 8 anni fa
parent
commit
46cc34fa73

+ 3 - 1
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -6513,7 +6513,9 @@
 #pragma mark - Banner Delegate
 
 - (void)commonEditorBannerCell:(CommonEditorBannerCell *)cell didClickItemAtIndexPath:(NSIndexPath *)indexPath {
-   
+    if ([[[cell content] objectForKey:@"count"] integerValue] == 0) {
+        return;
+    }
     ContentPreviewController *preVC = [[UIStoryboard storyboardWithName:@"PhotoList" bundle:nil] instantiateViewControllerWithIdentifier:@"ContentPreviewController"];
     preVC.content = [cell content];
 

+ 3 - 0
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m

@@ -1203,6 +1203,9 @@
         
         return;
     } else {
+        if ([[self.stack_contents objectForKey:@"count"] integerValue] == 0) {
+            return;
+        }
         ContentPreviewController *preVC = [[UIStoryboard storyboardWithName:@"PhotoList" bundle:nil] instantiateViewControllerWithIdentifier:@"ContentPreviewController"];
         preVC.content = self.stack_contents;
 //        preVC.currentIndex = index;

+ 3 - 0
RedAnt ERP Mobile/common/Functions/modelDetail/HomerModelDetailHeaderCell.m

@@ -927,6 +927,9 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
         
         return;
     } else {
+        if ([[self.stack_contents objectForKey:@"count"] integerValue] == 0) {
+            return;
+        }
         ContentPreviewController *preVC = [[UIStoryboard storyboardWithName:@"PhotoList" bundle:nil] instantiateViewControllerWithIdentifier:@"ContentPreviewController"];
         preVC.content = self.stack_contents;
         //        preVC.currentIndex = index;

+ 3 - 0
RedAnt ERP Mobile/common/PhotoList/Controller/ContentPreviewController.m

@@ -218,6 +218,9 @@
 #pragma mark - CollectionView DataSource
 
 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
+    if ([self.photos count] == 0) {
+        return 0;
+    }
     return self.photos.count + 2;
 }