[Android] src: Fix NullPointerException in MediaInfoActivity

Edward Wang git at videolan.org
Tue Jul 3 03:12:20 CEST 2012


android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Mon Jul  2 21:12:14 2012 -0400| [332793dda26ff557bd000f76c5f62c02dafa974e] | committer: Edward Wang

src: Fix NullPointerException in MediaInfoActivity

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=332793dda26ff557bd000f76c5f62c02dafa974e
---

 vlc-android/src/org/videolan/vlc/gui/video/MediaInfoActivity.java |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoActivity.java
index 8048ade..b681bf8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoActivity.java
@@ -65,6 +65,10 @@ public class MediaInfoActivity extends ListActivity {
         if (MRL == null)
             return;
         mItem = MediaLibrary.getInstance(this).getMediaItem(MRL);
+        if(mItem == null) {
+            // Shouldn't happen, maybe user opened it faster than Media Library could index it
+            return;
+        }
 
         // set title
         TextView titleView = (TextView) findViewById(R.id.title);



More information about the Android mailing list