Commit 8dbea4ac authored by Thomas Guillem's avatar Thomas Guillem
Browse files

AudioUtil: don't query cover if album is null

parent d5f55e56
......@@ -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()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment