[Android] Avoid NPE

Geoffrey Métais git at videolan.org
Wed Mar 4 13:27:41 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar  4 13:21:20 2015 +0100| [3b6af2fcb9109d9fe1475d81f8c138e5104f5d40] | committer: Geoffrey Métais

Avoid NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
index 17ffd3c..c8edac5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
@@ -97,7 +97,7 @@ public class MediaInfoFragment extends ListFragment {
         if (!LibVlcUtil.isICSOrLater())
             mDelete.setText(getString(R.string.delete).toUpperCase(Locale.getDefault()));
 
-        mPathView.setText(Uri.decode(mItem.getLocation().substring(7)));
+        mPathView.setText(mItem == null ? "" : Uri.decode(mItem.getLocation().substring(7)));
         mPlayButton.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {



More information about the Android mailing list