Permalink
Browse files

Merge pull request #18 from NSElvis/master

Added validators to the attribute accessor.
  • Loading branch information...
2 parents dfe17bf + 07d5b4b commit 291a58593a0683df01e3219e108032ee94083ed2 @topfunky committed Jul 17, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 TFHppleElement.m
View
6 TFHppleElement.m
@@ -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 291a585

Please sign in to comment.