Pārlūkot izejas kodu

handle null title (#968)

Ran 7 gadus atpakaļ
vecāks
revīzija
6fe8597c1f
1 mainītis faili ar 10 papildinājumiem un 2 dzēšanām
  1. 10
    2
      ios/Helpers/RCCTitleViewHelper.m

+ 10
- 2
ios/Helpers/RCCTitleViewHelper.m Parādīt failu

@@ -40,13 +40,21 @@ navigationController:(UINavigationController*)navigationController
40 40
     if (self) {
41 41
         self.viewController = viewController;
42 42
         self.navigationController = navigationController;
43
-        self.title = title;
44
-        self.subtitle = subtitle;
43
+        self.title = [RCCTitleViewHelper validateString:title];
44
+        self.subtitle = [RCCTitleViewHelper validateString:subtitle];
45 45
         self.titleImageData = titleImageData;
46 46
     }
47 47
     return self;
48 48
 }
49 49
 
50
++(NSString*)validateString:(NSString*)string {
51
+    if ([string isEqual:[NSNull null]]) {
52
+        return nil;
53
+    }
54
+    
55
+    return string;
56
+}
57
+
50 58
 -(void)setup:(NSDictionary*)style
51 59
 {
52 60
     if (!self.navigationController)