Skip to content

Commit

Permalink
Merge pull request #18 from NSElvis/master
Browse files Browse the repository at this point in the history
Added validators to the attribute accessor.
  • Loading branch information
topfunky committed Jul 17, 2012
2 parents dfe17bf + 07d5b4b commit 291a585
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions TFHppleElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 291a585

Please sign in to comment.