From 5c573b9a76934fb0fbbabb1f388318b4d95ebd78 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Fri, 21 Apr 2017 14:12:48 -0400 Subject: [PATCH] (fix) small fixes over previous commit --- SOPE/NGCards/CardElement.m | 2 +- SoObjects/Contacts/NGVCard+SOGo.m | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SOPE/NGCards/CardElement.m b/SOPE/NGCards/CardElement.m index d87b65509..6b103539f 100644 --- a/SOPE/NGCards/CardElement.m +++ b/SOPE/NGCards/CardElement.m @@ -136,7 +136,7 @@ { NSMutableArray *oldValues, *subValues; - if ([newValues isKindOfClass: [NSString class]]) + if (newValues && [newValues isKindOfClass: [NSString class]]) return [self setSingleValue: (NSString *)newValues atIndex: idx forKey: key]; diff --git a/SoObjects/Contacts/NGVCard+SOGo.m b/SoObjects/Contacts/NGVCard+SOGo.m index 48419ebec..b430e124d 100644 --- a/SoObjects/Contacts/NGVCard+SOGo.m +++ b/SoObjects/Contacts/NGVCard+SOGo.m @@ -314,19 +314,20 @@ convention: o = [ldifRecord objectForKey: @"o"]; if ([o isKindOfClass: [NSArray class]]) [units addObjectsFromArray: (NSArray *)o]; - else if (ou) + else if (o) [units addObject: o]; [self setOrganizations: units]; [self _setPhoneValues: ldifRecord]; [self _setEmails: ldifRecord]; [[self elementWithTag: @"url" ofType: @"home"] - setValues: [ldifRecord objectForKey: @"mozillahomeurl"] forKey: @""]; + setValues: [ldifRecord objectForKey: @"mozillahomeurl"] atIndex: 0 forKey: @""]; [[self elementWithTag: @"url" ofType: @"work"] - setValues: [ldifRecord objectForKey: @"mozillaworkurl"] forKey: @""]; + setValues: [ldifRecord objectForKey: @"mozillaworkurl"] atIndex: 0 forKey: @""]; [[self uniqueChildWithTag: @"x-aim"] setValues: [ldifRecord objectForKey: @"nsaimid"] + atIndex: 0 forKey: @""]; now = [NSCalendarDate date];