diff options
author | Vitaly Takmazov | 2022-12-22 13:36:39 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-22 13:36:39 +0300 |
commit | 45aee103c3470feef56fdbf308dca914db879320 (patch) | |
tree | 79d0f0bd6dbc282bcbb01c627e50957ad98296b5 /Juick | |
parent | 694d1c0a94b5d68685004ee93108cf3cb1dcd404 (diff) |
Range check on messages array
Diffstat (limited to 'Juick')
-rw-r--r-- | Juick/ViewControllers/MessagesViewController.m | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index fb3f63b..804b47b 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -148,7 +148,7 @@ NSString* const messageCellIdentifier = @"messageCell"; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - if (self.dataLoading && self.messages.count == 0) { + if ((self.dataLoading && self.messages.count == 0) || indexPath.row >= self.messages.count) { return [tableView dequeueReusableCellWithIdentifier:@"contentLoadingCell"]; } else { Message *msg = [self.messages objectAtIndex:indexPath.row]; |