Check for null entries in ConcatenatingMediaSource

We do this in the dynamic case, and I think we've seen
a few GitHub issues where developers do this and don't
understand what they've done wrong (because the failure
comes later).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163688557
This commit is contained in:
olly 2017-07-31 07:00:10 -07:00 committed by Oliver Woodman
parent c2d7e05429
commit 3ec0ccabbc

View file

@ -57,6 +57,9 @@ public final class ConcatenatingMediaSource implements MediaSource {
* {@link MediaSource} instance to be present more than once in the array.
*/
public ConcatenatingMediaSource(boolean isRepeatOneAtomic, MediaSource... mediaSources) {
for (MediaSource mediaSource : mediaSources) {
Assertions.checkNotNull(mediaSource);
}
this.mediaSources = mediaSources;
this.isRepeatOneAtomic = isRepeatOneAtomic;
timelines = new Timeline[mediaSources.length];