Преглед изворни кода

Fix when a title image has nil or NSNull (#3033)

This was occuring if a title has no properties set initially, but then are configured later. The title image data would go from [NSNull null] to nil, breaking this check.

By comparing against both values, we can ensure the correct logic for all behaviors.
Eli Perkins пре 6 година
родитељ
комит
22f743bf5f
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4
    1
      ios/Helpers/RCCTitleViewHelper.m

+ 4
- 1
ios/Helpers/RCCTitleViewHelper.m Прегледај датотеку

@@ -115,7 +115,10 @@ navigationController:(UINavigationController*)navigationController
115 115
 
116 116
 -(BOOL)isTitleOnly
117 117
 {
118
-    return self.title && !self.subtitle && !self.titleImageData;
118
+    BOOL hasNoImageData = [[NSNull null] isEqual:self.titleImageData] || self.titleImageData == nil;
119
+    return self.title != nil &&
120
+        self.subtitle == nil &&
121
+        hasNoImageData;
119 122
 }
120 123
 
121 124