Protect scrollToBottom

This commit is contained in:
Guillaume BIENKOWSKI 2014-03-10 10:16:59 +01:00
parent f54fe6a7d0
commit 1ef6478312

View file

@ -94,9 +94,11 @@
- (void)scrollToBottom:(BOOL)animated {
[self.tableView reloadData];
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:([data count] - 1) inSection:0]
atScrollPosition:UITableViewScrollPositionBottom
animated:YES];
if( [data count] ){
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:([data count] - 1) inSection:0]
atScrollPosition:UITableViewScrollPositionBottom
animated:YES];
}
}
- (void)scrollToLastUnread:(BOOL)animated {