From d64ae49c5113fbf49e9b0b857650bf2a85b6c368 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 2 Apr 2013 10:25:18 +0200 Subject: [PATCH] Fix issue 000624: App crash when editing contact in address book. Do not try to animate the email section of the contact details if it is not shown. --- Classes/ContactDetailsTableViewController.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index 1ac0bf331..8f49fd838 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -643,7 +643,8 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C #pragma mark - UITableViewDelegate Functions -- (void)setEditing:(BOOL)editing animated:(BOOL)animated { +- (void)setEditing:(BOOL)editing animated:(BOOL)animated { + bool_t showEmails = [[LinphoneManager instance] lpConfigBoolForKey:@"show_contacts_emails_preference"]; // Resign keyboard if(!editing) { [LinphoneUtils findAndResignFirstResponder:[self tableView]]; @@ -659,14 +660,14 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C for (int section = 0; section < [self numberOfSectionsInTableView:[self tableView]]; ++section) { if(contactSections[section] == ContactSections_Number || contactSections[section] == ContactSections_Sip || - contactSections[section] == ContactSections_Email) + (showEmails && contactSections[section] == ContactSections_Email)) [self addEntry:self.tableView section:section animated:animated]; } } else { for (int section = 0; section < [self numberOfSectionsInTableView:[self tableView]]; ++section) { if(contactSections[section] == ContactSections_Number || contactSections[section] == ContactSections_Sip || - contactSections[section] == ContactSections_Email) + (showEmails && contactSections[section] == ContactSections_Email)) [self removeEmptyEntry:self.tableView section:section animated:animated]; } }