Merge pull request #534 from expo/@terribleben/fix-percentage-convert-crash

Fix crash when passing wrong type to percentage prop on iOS
This commit is contained in:
Brent Vatne
2017-12-11 11:30:51 -08:00
committed by GitHub
+3
View File
@@ -47,6 +47,9 @@ static NSRegularExpression* percentageRegExp;
+ (BOOL)isPercentage:(NSString *) string
{
if (![string isKindOfClass:[NSString class]]) {
return NO;
}
return [percentageRegExp firstMatchInString:string options:0 range:NSMakeRange(0, [string length])] != nil;
}