fix: NPE in MediaManager.scrobble()#447
Open
tinsukE wants to merge 2 commits intoeddyizm:developmentfrom
Open
Conversation
tinsukE
commented
Feb 18, 2026
| } | ||
|
|
||
| @JvmStatic | ||
| fun onBrowserReleased(released: MediaBrowser?) { |
Contributor
Author
There was a problem hiding this comment.
This is unused. Any clue of where should it be called from?
Owner
There was a problem hiding this comment.
Off the top of my head I am not sure. But we can get rid of it if is not used.
How much testing have you done with this build, outside of the Chromecast?
Contributor
Author
There was a problem hiding this comment.
Not much, to be honest. Although I tried to keep the conversion as 1:1 as possible.
Is there anything you think worth it manually testing?
Or I could revert the changes and just fix the NPE on Java.
Owner
There was a problem hiding this comment.
No, no, I like the conversion to kotlin, just need to make sure there are no weird side effects.
I am going to figure out how to create a debug prerelease.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was watching #16 because I'm a heavy Chromecast Audio user and tried out the latest release. While that fix made the Chromecast experience better, I was still experiencing somewhat constant crashes.
I couldn't get an exact list of steps to reproduce it, sometimes doing the same thing worked, other times it crashed. But my testing routine constantly managed to reproduce a crash by randomly trying things like:
The crash was almost always a NPE on
MediaManager.scrobble():MediaMetadata.extrasis nullable, but isn't being handled properly: https://developer.android.com/reference/androidx/media3/common/MediaMetadata#extras()Instead of making a huge "check if null" chain, I bit the bullet and converted the class to Kotlin.
Besides idiomatic Kotlin changes, the only 2 logical changes were the bugfix:
And a pair of extension functions
ListenableFuture<MediaBrowser>?.onComplete()to remove duplicated code/logic.Stack trace of the NPE:
And a yet more elusive Chromecast crash that I'll try to track down (not fixed here), which I think is related to shuffled playlists: