Skip to content

Commit

Permalink
Fix checking imaAdMediaInfo nullness
Browse files Browse the repository at this point in the history
It's intended to log a warning in this case, rather than throw.

Issue: #8290

#minor-release

PiperOrigin-RevId: 347790527
  • Loading branch information
andrewlewis authored and christosts committed Dec 17, 2020
1 parent 5a6c99e commit e791e3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
([#3750](https:/google/ExoPlayer/issues/3750)).
* Fix a condition where playback can get stuck before an empty ad
([#8205](https:/google/ExoPlayer/issues/8205)).
* Log a warning rather than throwing when reaching the end of the stream
with an ad playing but without ad media info
([#8290](https:/google/ExoPlayer/issues/8290)).
* Add `ImaAdsLoader.Builder.setEnableContinuousPlayback` for setting
whether to request ads for continuous playback.
* Metadata retriever:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ private void handlePlayerStateChanged(boolean playWhenReady, @Player.State int p
&& playWhenReady) {
ensureSentContentCompleteIfAtEndOfStream();
} else if (imaAdState != IMA_AD_STATE_NONE && playbackState == Player.STATE_ENDED) {
AdMediaInfo adMediaInfo = checkNotNull(imaAdMediaInfo);
@Nullable AdMediaInfo adMediaInfo = imaAdMediaInfo;
if (adMediaInfo == null) {
Log.w(TAG, "onEnded without ad media info");
} else {
Expand Down

0 comments on commit e791e3c

Please sign in to comment.