diff --git a/SoObjects/Contacts/NGVCard+SOGo.m b/SoObjects/Contacts/NGVCard+SOGo.m index ee82415f9..e9767a6c8 100644 --- a/SoObjects/Contacts/NGVCard+SOGo.m +++ b/SoObjects/Contacts/NGVCard+SOGo.m @@ -193,24 +193,27 @@ convention: NSEnumerator *list; CardElement *element; - // value is either an array or a string - if ([value isKindOfClass: [NSString class]]) - allValues = [NSArray arrayWithObject: value]; - else - allValues = value; - - // Add all values as separate elements - list = [allValues objectEnumerator]; - while ((value = [list nextObject])) + if ([value isNotNull]) { - if ([type length]) - element = [CardElement simpleElementWithTag: elementTag - singleType: type - value: value]; + // value is either an array or a string + if ([value isKindOfClass: [NSString class]]) + allValues = [NSArray arrayWithObject: value]; else - element = [CardElement simpleElementWithTag: elementTag - value: value]; - [self addChild: element]; + allValues = value; + + // Add all values as separate elements + list = [allValues objectEnumerator]; + while ((value = [list nextObject])) + { + if ([type length]) + element = [CardElement simpleElementWithTag: elementTag + singleType: type + value: value]; + else + element = [CardElement simpleElementWithTag: elementTag + value: value]; + [self addChild: element]; + } } } @@ -380,7 +383,7 @@ convention: o = [ldifRecord objectForKey: @"description"]; if ([o isKindOfClass: [NSArray class]]) [self setNotes: o]; - else + else if ([o isNotNull]) [self setNote: o]; o = [ldifRecord objectForKey: @"vcardcategories"]; @@ -389,7 +392,7 @@ convention: // string (from a LDIF import) as the value here. if ([o isKindOfClass: [NSArray class]]) [self setCategories: o]; - else + else if ([o isNotNull]) [self setCategories: [o componentsSeparatedByString: @","]]; // Photo diff --git a/SoObjects/SOGo/SQLSource.m b/SoObjects/SOGo/SQLSource.m index dc0045ec7..39a66cc5c 100644 --- a/SoObjects/SOGo/SQLSource.m +++ b/SoObjects/SOGo/SQLSource.m @@ -521,6 +521,7 @@ for (i = 0; i < [_mailFields count]; i++) if ((s = [response objectForKey: [_mailFields objectAtIndex: i]]) && + [s isNotNull] && [[s stringByTrimmingSpaces] length] > 0) [emails addObjectsFromArray: [s componentsSeparatedByString: @" "]]; }