diff options
author | Vitaly Takmazov | 2019-03-29 09:37:25 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-03-29 09:37:25 +0300 |
commit | 1ff58ba417592f9034acaaa74c7f3435dee7f0d3 (patch) | |
tree | 551744b5574314256892ef0b242229105b0c1647 /Juick/ViewControllers | |
parent | 3f744a7e2bbb903c87cda306c490c6dcdfe9b9a2 (diff) |
Fix crash when pushed to thread with banned items
Diffstat (limited to 'Juick/ViewControllers')
-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 f2a20a9..afa0f9a 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -73,7 +73,7 @@ NSString* const messageCellIdentifier = @"messageCell"; NSInteger messagesCount = [self.messages count]; if (messagesCount > 0) { NSInteger itemToScroll = [self.firstUnread integerValue] ? : self.messages.count - 1; - NSIndexPath *lastRow = [NSIndexPath indexPathForRow:MIN(itemToScroll, messagesCount) inSection:0]; + NSIndexPath *lastRow = [NSIndexPath indexPathForRow:MIN(itemToScroll, messagesCount - 1) inSection:0]; [self.tableView scrollToRowAtIndexPath:lastRow atScrollPosition:UITableViewScrollPositionBottom animated:NO]; } self.firstUnread = nil; |