NSEnumerator *cards;
CardGroup *currentCard;
- cardParser = [self cardParser];
- [sax setTopElementClass: [self class]];
+ cardGroups = nil;
- if (parser)
+ if (source)
{
- cardGroups = [NSMutableArray new];
- [cardGroups autorelease];
-
- [parser parseFromSource: source];
- cards = [[sax cards] objectEnumerator];
-
- currentCard = [cards nextObject];
- while (currentCard)
- {
- [cardGroups addObject: currentCard];
- currentCard = [cards nextObject];
- }
+ cardParser = [self cardParser];
+ [sax setTopElementClass: [self class]];
+
+ if (parser)
+ {
+ cardGroups = [NSMutableArray new];
+ [cardGroups autorelease];
+
+ [parser parseFromSource: source];
+ cards = [[sax cards] objectEnumerator];
+
+ currentCard = [cards nextObject];
+ while (currentCard)
+ {
+ [cardGroups addObject: currentCard];
+ currentCard = [cards nextObject];
+ }
+ }
}
- else
- cardGroups = nil;
return cardGroups;
}
+2007-11-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * CardGroup.m ([CardGroup +parseFromSource:source]): make sure the
+ given source is not nil, otherwise the parser will raise an
+ exception, which we don't want.
+
2007-10-29 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* CardElement.m ([CardElement -value:anInt]): added handling for