[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Mon May 4 13:55:47 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon May  4 09:34:52 2015 +0200| [97be49d3503ceed4af69d28b42aaf9ed163f5b8a] | committer: Geoffrey Métais

Prevent NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/SearchSuggestionsAdapter.java b/vlc-android/src/org/videolan/vlc/gui/SearchSuggestionsAdapter.java
index df7b6f6..fbc8bbc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SearchSuggestionsAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SearchSuggestionsAdapter.java
@@ -76,6 +76,8 @@ public class SearchSuggestionsAdapter extends CursorAdapter {
         tv1.setText(cursor.getString(cursor.getColumnIndex(MediaDatabase.MEDIA_TITLE)));
         view.setBackgroundColor(backgroundColor);
 
+        if (mw == null)
+            return;
         String artist = mw.getAlbumArtist();
         if (artist == null)
             artist = mw.getArtist();



More information about the Android mailing list