Browse Source

handle null title (#968)

Ran 7 years ago
parent
commit
6fe8597c1f
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      ios/Helpers/RCCTitleViewHelper.m

+ 10
- 2
ios/Helpers/RCCTitleViewHelper.m View File

40
     if (self) {
40
     if (self) {
41
         self.viewController = viewController;
41
         self.viewController = viewController;
42
         self.navigationController = navigationController;
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
         self.titleImageData = titleImageData;
45
         self.titleImageData = titleImageData;
46
     }
46
     }
47
     return self;
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
 -(void)setup:(NSDictionary*)style
58
 -(void)setup:(NSDictionary*)style
51
 {
59
 {
52
     if (!self.navigationController)
60
     if (!self.navigationController)