diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 49a374312f8..cb6dbe6f28b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -52,6 +52,9 @@ ([#3750](https://github.com/google/ExoPlayer/issues/3750)). * Fix a condition where playback can get stuck before an empty ad ([#8205](https://github.com/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://github.com/google/ExoPlayer/issues/8290)). * Add `ImaAdsLoader.Builder.setEnableContinuousPlayback` for setting whether to request ads for continuous playback. * Metadata retriever: diff --git a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/AdTagLoader.java b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/AdTagLoader.java index b5fd13e6f9e..551c88ac3d2 100644 --- a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/AdTagLoader.java +++ b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/AdTagLoader.java @@ -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 {