forked from mirrors/linphone-iphone
Fix crash in Contacts when adding a contact. This was a bad refactoring
This commit is contained in:
parent
4dc4fca33e
commit
234f86cf4e
1 changed files with 8 additions and 3 deletions
|
|
@ -426,12 +426,17 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
|
|||
ABPropertyID property = [self propertyIDForSection:contactSections[section]];
|
||||
if( property != kABInvalidPropertyType ){
|
||||
ABMultiValueRef lMap = ABRecordCopyValue(contact, property);
|
||||
NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]);
|
||||
CFTypeRef valueRef = ABMultiValueCopyValueAtIndex(lMap, index);
|
||||
NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]);
|
||||
CFTypeRef valueRef = ABMultiValueCopyValueAtIndex(lMap, index);
|
||||
CFTypeRef toRelease = valueRef;
|
||||
if (property == kABPersonInstantMessageProperty ) {
|
||||
// when we query the instanteMsg property we get a dictionary instead of a value
|
||||
valueRef = CFDictionaryGetValue(valueRef, kABPersonInstantMessageUsernameKey);
|
||||
}
|
||||
if(![(NSString*) valueRef length]) {
|
||||
[self removeEntry:tableview path:[NSIndexPath indexPathForRow:row inSection:section] animated:animated];
|
||||
}
|
||||
CFRelease(valueRef);
|
||||
CFRelease(toRelease);
|
||||
CFRelease(lMap);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue