fix crash when adding to quickly a first contact on an empty list on ipad

This commit is contained in:
REIS Benjamin 2016-10-28 15:30:45 +02:00
parent 73fd1837f5
commit 798f6c593c

View file

@ -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];
}