[Android] [PATCH] AudioUtil: don't query cover if album is null
Thomas Guillem
thomas at gllm.fr
Wed Dec 31 10:29:42 CET 2014
---
vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
index 37f1f8e..bfd3edb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
@@ -153,13 +153,16 @@ public class AudioUtil {
}
private static String getCoverFromMediaStore(Context context, Media media) {
+ final String album = media.getAlbum();
+ if (album == null)
+ return null;
ContentResolver contentResolver = context.getContentResolver();
Uri uri = android.provider.MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
Cursor cursor = contentResolver.query(uri, new String[] {
MediaStore.Audio.Albums.ALBUM,
MediaStore.Audio.Albums.ALBUM_ART },
MediaStore.Audio.Albums.ALBUM + " LIKE ?",
- new String[] { media.getAlbum() }, null);
+ new String[] { album }, null);
if (cursor == null) {
// do nothing
} else if (!cursor.moveToFirst()) {
--
2.1.3
More information about the Android
mailing list