androidx.media3.cast.CastPlayer: NullPointerException DefaultMediaItemConverter.toMediaItem 88
@marcbaechinger is already working on this.
Since Dec 9, 2024.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.4.1
More version details
No response
Devices that reproduce the issue
Can't reproduce, get crash via firebase crashlytics
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
- Take an application with Cast implementation without androidx.media3.cast.CastPlayer
- Start cast
- Take an application with androidx.media3.cast.CastPlayer
- Start cast too
Expected result
The media play successfully
Actual result
java.lang.NullPointerException
Media
Attached a screenshot of the crash from firebase crashlytics
couldn't reproduce the crash
use DefaultMediaItemConverter
I search existing issues, but can't find related bug in media3 or ExoPlayer repo
I find the same bug in Conned-SDK-Android - https://github.com/ConnectSDK/Connect-SDK-Android/issues/376
Looks like the crash has been reproduced in Jun 9, 2023 (exoplayer2.ext.cast.CastPlayer)
Do you have any ideas on how to fix this?
Do you need any additional information?
I can see comment in DefaultMediaItemConverter, mediaQueueItem came from toMediaQueueItem() so the custom JSON data must be set.
When is getCustomData expected to be null?
I was pondering a decision, but it confuses me that it costs checking and an exception is purposefully thrown Assertions.checkNotNull
What do you think about this fix?
if (mediaInfo.getCustomData() == null) {
return MediaItem.EMPTY;
}
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.