From 0d3e0c201e78e1bfddc84be94c2fe3eeb6a5ae93 Mon Sep 17 00:00:00 2001 From: John Zhen M Date: Thu, 12 Oct 2017 22:29:54 -0700 Subject: [PATCH] -Fixed MediaSourceManager from inserting already inserted entry. --- .../org/schabi/newpipe/player/playback/MediaSourceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java b/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java index 8e5217c6b..ff139e9d7 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java +++ b/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java @@ -273,7 +273,7 @@ public class MediaSourceManager implements DeferredMediaSource.Callback { * If the play queue index already exists, then the insert is ignored. * */ private void insert(final int queueIndex, final DeferredMediaSource source) { - if (queueIndex < 0) return; + if (queueIndex < 0 || queueIndex < sources.getSize()) return; sources.addMediaSource(queueIndex, source); }