Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSRangeException: Attempted to scroll the table view to an out-of-bounds row (3) when there are only 3 rows in sect... #22668

Closed
sentry-io bot opened this issue Feb 22, 2024 · 2 comments

Comments

@sentry-io
Copy link

sentry-io bot commented Feb 22, 2024

Sentry Issue: JETPACK-IOS-193E

NSRangeException: Attempted to scroll the table view to an out-of-bounds row (3) when there are only 3 rows in section 0. Table view: <UITableView: 0x12a7a1000; frame = (0 0; 414 566); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x2832a4000>; layer = <CALayer: 0x283820800>; contentOffset: {0, 0}; contentSize: {414, 858.33333333333326}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <WPTableViewHandler: 0x280c53960>>
  File "ReaderCommentsViewController.m", line 887, in -[ReaderCommentsViewController navigateToCommentIDIfNeeded]
  File "ReaderCommentsViewController.m", line 847, in -[ReaderCommentsViewController refreshTableViewAndNoResultsView]
  ?, in WPContentSyncHelper.syncContentWithUserInteraction
  File "<compiler-generated>", in WPContentSyncHelper.syncContentWithUserInteraction
  File "<compiler-generated>", in thunk for closure
...
(50 additional frame(s) were not displayed)

This is currently only affecting one user in Jetpack iOS 24.2.

@dvdchr
Copy link
Contributor

dvdchr commented Feb 22, 2024

Assigning this a Medium priority since it's a crash (high severity) that's affecting a very low number of users (low impact).

I'm not sure why this happened in 24.2, seeing that the stack trace points to code that has been left untouched for a while. We could probably prevent the crash by ensuring that the index path exists in the table view before telling it to scroll.

[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];

@dvdchr
Copy link
Contributor

dvdchr commented Mar 1, 2024

Closing as this is a duplicate of #20742

@dvdchr dvdchr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant