Permalink
Browse files

Added validators that crash the app when a kye is not found.

  • Loading branch information...
1 parent dfe17bf commit 07d5b4bd27f85bc9d56c1873aa41035845da7d0a @3lvis 3lvis committed Jul 16, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 TFHppleElement.m
View
@@ -95,8 +95,10 @@ - (NSDictionary *) attributes
{
NSMutableDictionary * translatedAttributes = [NSMutableDictionary dictionary];
for (NSDictionary * attributeDict in [node objectForKey:TFHppleNodeAttributeArrayKey]) {
- [translatedAttributes setObject:[attributeDict objectForKey:TFHppleNodeContentKey]
- forKey:[attributeDict objectForKey:TFHppleNodeAttributeNameKey]];
+ if ([attributeDict objectForKey:TFHppleNodeContentKey] && [attributeDict objectForKey:TFHppleNodeAttributeNameKey]) {
+ [translatedAttributes setObject:[attributeDict objectForKey:TFHppleNodeContentKey]
+ forKey:[attributeDict objectForKey:TFHppleNodeAttributeNameKey]];
+ }
}
return translatedAttributes;
}

0 comments on commit 07d5b4b

Please sign in to comment.