From 798f6c593c9db9f9643dd908beb129ad81a1e8a4 Mon Sep 17 00:00:00 2001 From: REIS Benjamin Date: Fri, 28 Oct 2016 15:30:45 +0200 Subject: [PATCH] fix crash when adding to quickly a first contact on an empty list on ipad --- Classes/ContactsListTableView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/ContactsListTableView.m b/Classes/ContactsListTableView.m index f1d9f78a8..9ea61f4f4 100644 --- a/Classes/ContactsListTableView.m +++ b/Classes/ContactsListTableView.m @@ -176,7 +176,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { // since we refresh the tableview, we must perform this on main thread dispatch_async(dispatch_get_main_queue(), ^(void) { if (IPAD) { - if (![self selectFirstRow]) { + if (!([self totalNumberOfItems] > 0)) { ContactDetailsView *view = VIEW(ContactDetailsView); [view setContact:nil]; } @@ -257,7 +257,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { // since we refresh the tableview, we must perform this on main thread dispatch_async(dispatch_get_main_queue(), ^(void) { if (IPAD) { - if (![self selectFirstRow]) { + if (!([self totalNumberOfItems] > 0)) { ContactDetailsView *view = VIEW(ContactDetailsView); [view setContact:nil]; }