From 5e3cd7a3c3f2cd590d77ccd318c5ba4824f414b8 Mon Sep 17 00:00:00 2001 From: ibaker Date: Fri, 10 Feb 2023 11:44:14 +0000 Subject: [PATCH] Add null check to `ExoPlayerImpl.isTunnelingEnabled` `TrackSelectorResult.rendererConfigurations` can contain null elements: > A null entry indicates the corresponding renderer should be disabled. This wasn't caught by the nullness checker because `ExoPlayerImpl` is currently excluded from analysis. #minor-release Issue: google/ExoPlayer#10977 PiperOrigin-RevId: 508619169 --- .../java/com/google/android/exoplayer2/ExoPlayerImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index ead8179224c..3601f51805d 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -1714,8 +1714,9 @@ public void setDeviceMuted(boolean muted) { @Override public boolean isTunnelingEnabled() { verifyApplicationThread(); - for (RendererConfiguration config : playbackInfo.trackSelectorResult.rendererConfigurations) { - if (config.tunneling) { + for (@Nullable + RendererConfiguration config : playbackInfo.trackSelectorResult.rendererConfigurations) { + if (config != null && config.tunneling) { return true; } }