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
(cherry picked from commit 5e3cd7a3c3)
This commit is contained in:
ibaker 2023-02-10 11:44:14 +00:00 committed by tonihei
parent 58650b87d6
commit 2794992243

View file

@ -1713,8 +1713,9 @@ import java.util.concurrent.TimeoutException;
@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;
}
}