[Android] Media: fix crash

Jean-Baptiste Kempf git at videolan.org
Sat Mar 9 18:36:21 CET 2013


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Mar  9 18:30:57 2013 +0100| [aaab99e78a3238fd5165e3fcc02f27d71998798d] | committer: Jean-Baptiste Kempf

Media: fix crash

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

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

diff --git a/vlc-android/src/org/videolan/vlc/Media.java b/vlc-android/src/org/videolan/vlc/Media.java
index 65b0527..1aeb4f9 100644
--- a/vlc-android/src/org/videolan/vlc/Media.java
+++ b/vlc-android/src/org/videolan/vlc/Media.java
@@ -355,8 +355,10 @@ public class Media implements Comparable<Media> {
     public String getGenre() {
         if(mGenre == VLCApplication.getAppContext().getString(R.string.unknown_genre))
             return mGenre;
-        else /* Make genres case insensitive via normalisation */
+        else if( mGenre.length() > 1)/* Make genres case insensitive via normalisation */
             return Character.toUpperCase(mGenre.charAt(0)) + mGenre.substring(1).toLowerCase();
+        else
+            return mGenre;
     }
 
     public String getCopyright() {



More information about the Android mailing list