[Android] HistoryAdapter: avoid NullPointerException

Jean-Baptiste Kempf git at videolan.org
Sun Jul 6 08:24:11 CEST 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Jul  6 08:14:31 2014 +0200| [adcc282719b833a94ed286f30372f8f271058f38] | committer: Jean-Baptiste Kempf

HistoryAdapter: avoid NullPointerException

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
index a0d5fad..32a94dd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
@@ -94,6 +94,9 @@ public class HistoryAdapter extends BaseAdapter {
 
         String holderText = "";
         Media m = mLibVLC.getPrimaryMediaList().getMedia(position);
+        if (m == null )
+            return v;
+
         Log.d(TAG, "Loading media position " + position + " - " + m.getTitle());
         holder.title.setText(m.getTitle());
         holderText = m.getSubtitle();



More information about the Android mailing list