From 8c904f9c4ef7ac4fce8c797ee1f826433b0b0f7a Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 5 Sep 2016 15:20:28 +0200 Subject: [PATCH] ContactsListTableView.m: fix crash when searching some text --- Classes/ContactsListTableView.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/ContactsListTableView.m b/Classes/ContactsListTableView.m index ade16ade5..c88351e36 100644 --- a/Classes/ContactsListTableView.m +++ b/Classes/ContactsListTableView.m @@ -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];