Fix crash when passing wrong type to percentage prop

This commit is contained in:
Ben Roth
2017-12-04 17:25:48 -08:00
parent f94e17e3be
commit 9fa9667a93
+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;
}