Skip to content
Browse files

Merge pull request #11 from Thomazr/master

Return nil if no children are found with childrenNamed
  • Loading branch information...
2 parents 9bd1119 + 77b2230 commit cd97da6990f4d9d93c2dc1b8b6a7e1b0eb50d85a @nfarina committed Jan 5, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 SMXMLDocument.m
View
6 SMXMLDocument.m
@@ -114,7 +114,11 @@ - (NSArray *)childrenNamed:(NSString *)nodeName {
for (SMXMLElement *child in children)
if ([child.name isEqual:nodeName])
[array addObject:child];
- return [[array copy] autorelease];
+
+ if([array count] > 0)
+ return [[array copy] autorelease];
+ else
+ return nil;
}
- (SMXMLElement *)childWithAttribute:(NSString *)attributeName value:(NSString *)attributeValue {

0 comments on commit cd97da6

Please sign in to comment.
Something went wrong with that request. Please try again.