mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 07:59:28 +00:00
Fix crash when passing wrong type to percentage prop
This commit is contained in:
@@ -47,6 +47,9 @@ static NSRegularExpression* percentageRegExp;
|
|||||||
|
|
||||||
+ (BOOL)isPercentage:(NSString *) string
|
+ (BOOL)isPercentage:(NSString *) string
|
||||||
{
|
{
|
||||||
|
if (![string isKindOfClass:[NSString class]]) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
return [percentageRegExp firstMatchInString:string options:0 range:NSMakeRange(0, [string length])] != nil;
|
return [percentageRegExp firstMatchInString:string options:0 range:NSMakeRange(0, [string length])] != nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user