ContactsListTableView.m: fix crash when searching some text

This commit is contained in:
Gautier Pelloux-Prayer 2016-09-05 15:20:28 +02:00
parent cb158dfb04
commit 8c904f9c4e

View file

@ -133,7 +133,9 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) {
add = (contact.emails.count > 0);
}
NSMutableString *name = [[NSMutableString alloc] initWithString:[self displayNameForContact:contact]];
NSMutableString *name = [self displayNameForContact:contact]
? [[NSMutableString alloc] initWithString:[self displayNameForContact:contact]]
: nil;
if (add && name != nil) {
NSString *firstChar = [[name substringToIndex:1] uppercaseString];