Skip to content

Commit

Permalink
Add null check to ExoPlayerImpl.isTunnelingEnabled
Browse files Browse the repository at this point in the history
`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: #10977
PiperOrigin-RevId: 508619169
  • Loading branch information
icbaker authored and christosts committed Feb 10, 2023
1 parent 1c29131 commit 5e3cd7a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 5e3cd7a

Please sign in to comment.