diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index 04125d2bd..2476edc2a 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -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 {