mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 07:25:53 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user