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

Crash: Reader Detail contentForDisplay() is nil while being rendered #23193

Open
sentry-io bot opened this issue May 10, 2024 · 2 comments
Open

Crash: Reader Detail contentForDisplay() is nil while being rendered #23193

sentry-io bot opened this issue May 10, 2024 · 2 comments

Comments

@sentry-io
Copy link

sentry-io bot commented May 10, 2024

Sentry Issue: JETPACK-IOS-159H

EXC_BREAKPOINT: Exception 6, Code 1, Subcode 4310203832
  File "<compiler-generated>", in value
  File "ReaderDetailViewController.swift", line 291, in ReaderDetailViewController.render
  File "ReaderDetailCoordinator.swift", line 319, in ReaderDetailCoordinator.storeAuthenticationCookies
  ?, in RequestAuthenticator.requestForSelfHosted
  File "AuthenticationService.swift", line 93, in AuthenticationService.loadAuthCookiesForWPCom
...
(19 additional frame(s) were not displayed)
@dangermattic
Copy link
Collaborator

dangermattic commented May 10, 2024

Thanks for reporting! 👍

@dvdchr dvdchr changed the title EXC_BREAKPOINT: Exception 6, Code 1, Subcode 4310203832 Crash: Reader Detail contentForDisplay() is nil while being rendered May 10, 2024
@dvdchr
Copy link
Contributor

dvdchr commented May 10, 2024

This issue occurred 5 times, affecting 5 different users in v24.7. Here's where the exception was thrown from:

coordinator?.storeAuthenticationCookies(in: webView) { [weak self] in
self?.webView.loadHTMLString(post.contentForDisplay())
}

The crash happened because the post's contentForDisplay() unexpectedly returned nil. I suspect this involves state restoration, where the detail screen tried to render a post, but the managed object is not "hydrated" yet. See #23039 for a similar case.

We could silence this issue by ensuring that contentForDisplay() exists, or the more proper solution is to wait (and maybe show a loading state) until the object's properties are populated properly. I'm assigning this to myself for now since this is Reader-related.

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

2 participants