summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-22 13:36:39 +0300
committerGravatar Vitaly Takmazov2022-12-22 13:36:39 +0300
commit45aee103c3470feef56fdbf308dca914db879320 (patch)
tree79d0f0bd6dbc282bcbb01c627e50957ad98296b5 /Juick
parent694d1c0a94b5d68685004ee93108cf3cb1dcd404 (diff)
Range check on messages array
Diffstat (limited to 'Juick')
-rw-r--r--Juick/ViewControllers/MessagesViewController.m2
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];