ret = contacts_record_get_child_record_at_p(contact, _contacts_contact.name, 0, &name);
if (ret != CONTACTS_ERROR_NONE) {
MSG_DEBUG("contacts_record_get_child_record_at_p() Error [%d]", ret);
- contacts_record_destroy(contact, true);
- return false;
- }
-
- char* strFirstName = NULL;
- ret = contacts_record_get_str_p(name, _contacts_name.first, &strFirstName);
- if (ret != CONTACTS_ERROR_NONE) {
- MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
- contacts_record_destroy(contact, true);
- return false;
- }
+ } else {
+ char* strFirstName = NULL;
+ ret = contacts_record_get_str_p(name, _contacts_name.first, &strFirstName);
+ if (ret != CONTACTS_ERROR_NONE) {
+ MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
+ }
- char* strLastName = NULL;
- ret = contacts_record_get_str_p(name, _contacts_name.last, &strLastName);
- if (ret != CONTACTS_ERROR_NONE) {
- MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
- contacts_record_destroy(contact, true);
- return false;
- }
+ char* strLastName = NULL;
+ ret = contacts_record_get_str_p(name, _contacts_name.last, &strLastName);
+ if (ret != CONTACTS_ERROR_NONE) {
+ MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
+ }
- MSG_DEBUG("First Name : [%s], Last Name : [%s]", strFirstName, strLastName);
+ MSG_DEBUG("First Name : [%s], Last Name : [%s]", strFirstName, strLastName);
- if (strFirstName != NULL)
- strncpy(contactInfo.firstName, strFirstName, MAX_DISPLAY_NAME_LEN);
+ if (strFirstName != NULL)
+ strncpy(contactInfo.firstName, strFirstName, MAX_DISPLAY_NAME_LEN);
- if (strLastName != NULL)
- strncpy(contactInfo.lastName, strLastName, MAX_DISPLAY_NAME_LEN);
+ if (strLastName != NULL)
+ strncpy(contactInfo.lastName, strLastName, MAX_DISPLAY_NAME_LEN);
+ }
MsgStoClearContactInfo(&ContactDbHandle, index);