[Android] MediaGroup: fix StringIndexOutOfBoundsException

Geoffrey Métais git at videolan.org
Tue May 28 16:39:20 CEST 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue May 28 16:28:17 2019 +0200| [0edc34dbd61562eaa8ffc6f1932affd2a7326b6c] | committer: Geoffrey Métais

MediaGroup: fix StringIndexOutOfBoundsException

> https://code.videolan.org/videolan/vlc-android/commit/0edc34dbd61562eaa8ffc6f1932affd2a7326b6c
---

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

diff --git a/vlc-android/src/org/videolan/vlc/media/MediaGroup.kt b/vlc-android/src/org/videolan/vlc/media/MediaGroup.kt
index 08b6868a5..d28af818c 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaGroup.kt
+++ b/vlc-android/src/org/videolan/vlc/media/MediaGroup.kt
@@ -79,7 +79,7 @@ class MediaGroup private constructor(media: MediaWrapper, filename: Boolean) : M
 
                 //Handle titles starting with "The"
                 val groupOffset = if (group.startsWith("the")) 4 else 0
-                if (title.startsWith("the"))
+                if (title.startsWith("the") && title.length > 4)
                     title = title.substring(4)
 
                 // find common prefix



More information about the Android mailing list