From 1bf5b1292aa9e091815fe20b85607d5c74367ee3 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Mon, 23 Oct 2017 15:48:13 +0200 Subject: [PATCH] Fix - tableView cellForRowAtIndexPath: return a fake cell to prevent app from crashing. --- Riot/Model/Contact/ContactsDataSource.m | 2 -- Riot/ViewController/PeopleViewController.m | 3 ++- Riot/ViewController/RoomParticipantsViewController.m | 5 +++++ Riot/ViewController/StartChatViewController.m | 5 +++++ Riot/ViewController/UsersDevicesViewController.m | 5 +++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Riot/Model/Contact/ContactsDataSource.m b/Riot/Model/Contact/ContactsDataSource.m index 657878d01..b0ac22827 100644 --- a/Riot/Model/Contact/ContactsDataSource.m +++ b/Riot/Model/Contact/ContactsDataSource.m @@ -640,8 +640,6 @@ } return tableViewCell; } - - return nil; } - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath diff --git a/Riot/ViewController/PeopleViewController.m b/Riot/ViewController/PeopleViewController.m index 9dfa3502b..f2fb57b10 100644 --- a/Riot/ViewController/PeopleViewController.m +++ b/Riot/ViewController/PeopleViewController.m @@ -223,7 +223,8 @@ } } - return nil; + // Return a fake cell to prevent app from crashing. + return [[UITableViewCell alloc] init]; } - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath diff --git a/Riot/ViewController/RoomParticipantsViewController.m b/Riot/ViewController/RoomParticipantsViewController.m index f6bd6fea5..058137380 100644 --- a/Riot/ViewController/RoomParticipantsViewController.m +++ b/Riot/ViewController/RoomParticipantsViewController.m @@ -1123,6 +1123,11 @@ cell = participantCell; } + else + { + // Return a fake cell to prevent app from crashing. + cell = [[UITableViewCell alloc] init]; + } return cell; } diff --git a/Riot/ViewController/StartChatViewController.m b/Riot/ViewController/StartChatViewController.m index 459f62ec0..348e298a4 100644 --- a/Riot/ViewController/StartChatViewController.m +++ b/Riot/ViewController/StartChatViewController.m @@ -353,6 +353,11 @@ cell = participantCell; } + else + { + // Return a fake cell to prevent app from crashing. + cell = [[UITableViewCell alloc] init]; + } return cell; } diff --git a/Riot/ViewController/UsersDevicesViewController.m b/Riot/ViewController/UsersDevicesViewController.m index a92d779b6..a4a1d9364 100644 --- a/Riot/ViewController/UsersDevicesViewController.m +++ b/Riot/ViewController/UsersDevicesViewController.m @@ -169,6 +169,11 @@ cell = deviceCell; } + else + { + // Return a fake cell to prevent app from crashing. + cell = [[UITableViewCell alloc] init]; + } return cell; }