[Android] Fix IllegalArgumentException

Nicolas Pomepuy git at videolan.org
Tue Sep 7 07:36:38 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Sep  6 14:20:08 2021 +0200| [07cb6200889c1c914d73c8f83c1f7466b1742df3] | committer: Nicolas Pomepuy

Fix IllegalArgumentException

> https://code.videolan.org/videolan/vlc-android/commit/07cb6200889c1c914d73c8f83c1f7466b1742df3
---

 application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 80ca2f152..5333e2b83 100644
--- a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -631,7 +631,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
     }
 
     fun previousTotalTime() = when {
-        mediaList.size() == 0 -> {
+        mediaList.size() == 0 || currentIndex < 0 -> {
             0
         }
         shuffling -> {



More information about the Android mailing list