[Android] DirectoryViewFragment: avoid a crash

Jean-Baptiste Kempf git at videolan.org
Mon Oct 15 14:59:10 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Oct 15 14:58:36 2012 +0200| [3acb159177273181791c275c1d71123a7662949d] | committer: Jean-Baptiste Kempf

DirectoryViewFragment: avoid a crash

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
index 68ddce1..cf41833 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
@@ -160,7 +160,8 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
         String mediaFile = mDirectoryAdapter.getMediaLocation(p);
 
         try {
-            if(!LibVLC.getExistingInstance().hasVideoTrack(mediaFile)) {
+            if (LibVLC.getExistingInstance() == null
+                    || !LibVLC.getExistingInstance().hasVideoTrack(mediaFile)) {
                 audioController.load(mDirectoryAdapter.getAllMediaLocations(), p-1); /* p-1 to exclude ".," */
                 AudioPlayerActivity.start(getActivity());
             } else {



More information about the Android mailing list