[Android] Fix a StringIndexOutOfBoundsException

Ludovic Fauvet git at videolan.org
Sat Oct 13 19:53:40 CEST 2012


vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Sat Oct 13 19:51:54 2012 +0200| [5aa730e9c6213c8ebacb57f86d76e17127a1d23d] | committer: Ludovic Fauvet

Fix a StringIndexOutOfBoundsException

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=5aa730e9c6213c8ebacb57f86d76e17127a1d23d
---

 vlc-android/src/org/videolan/vlc/Media.java |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/Media.java b/vlc-android/src/org/videolan/vlc/Media.java
index ce38291..e0807f6 100644
--- a/vlc-android/src/org/videolan/vlc/Media.java
+++ b/vlc-android/src/org/videolan/vlc/Media.java
@@ -301,6 +301,8 @@ public class Media implements Comparable<Media> {
             return mTitle;
         else {
             int end = getFileName().lastIndexOf(".");
+            if (end <= 0)
+                return getFileName();
             return getFileName().substring(0, end);
         }
     }



More information about the Android mailing list