Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eliperkins authored and guyca committed Apr 15, 2018
1 parent 74a8c6b commit 22f743b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ios/Helpers/RCCTitleViewHelper.m
Expand Up @@ -115,7 +115,10 @@ -(void)setup:(NSDictionary*)style

-(BOOL)isTitleOnly
{
return self.title && !self.subtitle && !self.titleImageData;
BOOL hasNoImageData = [[NSNull null] isEqual:self.titleImageData] || self.titleImageData == nil;
return self.title != nil &&
self.subtitle == nil &&
hasNoImageData;
}


Expand Down

0 comments on commit 22f743b

Please sign in to comment.