From b0cf908e9bd33a67e20f339964596831c771aa8c Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 30 Jun 2011 10:27:27 +0200 Subject: [PATCH] fix crash in case of contact phone number without label --- Classes/LinphoneUI/FastAddressBook.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneUI/FastAddressBook.m b/Classes/LinphoneUI/FastAddressBook.m index ffb7e4336..ab1ccabeb 100644 --- a/Classes/LinphoneUI/FastAddressBook.m +++ b/Classes/LinphoneUI/FastAddressBook.m @@ -60,8 +60,8 @@ void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void Contact* lContact = [[Contact alloc] initWithRecord:lPerson ofType:(NSString *)lLocalizedLabel]; [lAddressBookMap setObject:lContact forKey:lNormalizedKey]; CFRelease(lValue); - CFRelease(lLabel); - CFRelease(lLocalizedLabel); + if (lLabel) CFRelease(lLabel); + if (lLocalizedLabel) CFRelease(lLocalizedLabel); } CFRelease(lPhoneNumbers); } @@ -86,7 +86,7 @@ void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void -(id) initWithRecord:(ABRecordRef) aRecord ofType:(NSString*) type { if ((self = [super init])) { record=CFRetain(aRecord); - numberType= [type retain]; + numberType= type?[type retain]:@"unkown"; } return self; }