From 008da5a4df6fe8e9aab0db9d2356662f916c2065 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Thu, 1 Nov 2007 22:36:11 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1216 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOPE/NGCards/CardGroup.m | 37 ++++++++++++++++++++----------------- SOPE/NGCards/ChangeLog | 6 ++++++ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/SOPE/NGCards/CardGroup.m b/SOPE/NGCards/CardGroup.m index be1c71e0..9571aa9b 100644 --- a/SOPE/NGCards/CardGroup.m +++ b/SOPE/NGCards/CardGroup.m @@ -72,26 +72,29 @@ static NGCardsSaxHandler *sax = nil; 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; } diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 09ec6734..801f2285 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,9 @@ +2007-11-01 Wolfgang Sourdeau + + * 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 * CardElement.m ([CardElement -value:anInt]): added handling for -- 2.39.5