[Android] AudioUtil: Fix a crash in context.getExternalCacheDir() return

Jean-Baptiste Kempf git at videolan.org
Wed Oct 17 15:21:33 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Oct 17 15:21:20 2012 +0200| [0985cdb87229d5c6bb771e93c910202cc3db711f] | committer: Jean-Baptiste Kempf

AudioUtil: Fix a crash in context.getExternalCacheDir() return

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
index 183104f..abd1592 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
@@ -81,7 +81,7 @@ public class AudioUtil {
 
     @SuppressLint("NewApi")
     public static void prepareCacheFolder(Context context) {
-        if (Util.isFroyoOrLater() && Util.hasExternalStorage())
+        if (Util.isFroyoOrLater() && Util.hasExternalStorage() && context.getExternalCacheDir() != null)
             CACHE_DIR = context.getExternalCacheDir().getPath();
         else
             CACHE_DIR = Environment.getExternalStorageDirectory().getPath() + "/Android/data/" + context.getPackageName() + "/cache";



More information about the Android mailing list