Merge pull request #2575 from pdsouza/pd/fix-exoplayer-codec-error-NPE

[Android] Fix app crash from NPE in Exoplayer error handler
This commit is contained in:
Eran Hammer 2022-04-19 15:35:07 -07:00 committed by GitHub
commit c5c4294127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -985,7 +985,8 @@ class ReactExoplayerView extends FrameLayout implements
// Special case for decoder initialization failures.
MediaCodecRenderer.DecoderInitializationException decoderInitializationException =
(MediaCodecRenderer.DecoderInitializationException) cause;
if (decoderInitializationException.codecInfo.name == null) {
if (decoderInitializationException.codecInfo == null
|| decoderInitializationException.codecInfo.name == null) {
if (decoderInitializationException.getCause() instanceof MediaCodecUtil.DecoderQueryException) {
errorString = getResources().getString(R.string.error_querying_decoders);
} else if (decoderInitializationException.secureDecoderRequired) {