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

Avoid crash when accessing and dismissing episode details from up next queue #1300

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

mchowning
Copy link
Contributor

Description

This avoids a crash that can occur when dismissing the episode details view.

This issue was introduced in #1282.

Testing Instructions

  1. Make sure you have the "General" setting for playing episodes when you tap them in your up next queue turned off (we need it to open the episode details screen).
  2. Open the up next queue without opening a podcast screen (if you go to a podcast screen first the crash doesn't happen)
  3. Tap on an episode to open the episode details view
  4. Dismiss the episode details view
  5. Observe that the app doesn't crash

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md (no changelog because this is a regression since the last release)
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews

@mchowning mchowning requested a review from a team as a code owner August 22, 2023 13:24
@mchowning
Copy link
Contributor Author

mchowning commented Aug 22, 2023

To add some more context. This issue arose because I mistakenly thought the only way to access the episode details screen was from the podcast screen. So I made this field lateinit since it needs to be initialized any time the podcast screen loads. Since the episode details screen can be accessed without going through the podcast screen, we don't need to ensure that the field is initialized, and it is safe for it to be nullable.

Copy link
Contributor

@ashiagr ashiagr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to reproduce the crash without the changes and I confirm that the crash is fixed now. 👍

@mchowning mchowning merged commit 1bd53d0 into release/7.46 Aug 22, 2023
@mchowning mchowning deleted the fix/episode-details-dismiss-crash branch August 22, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants