From d92081350906e65c8f04afa5f1f4304c9ae86f1c Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 27 Dec 2014 20:08:40 -0600 Subject: Fix crash if album is null --- src/github/daneren2005/dsub/util/ImageLoader.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/github/daneren2005/dsub/util/ImageLoader.java b/src/github/daneren2005/dsub/util/ImageLoader.java index 0342b6c9..48ff39ca 100644 --- a/src/github/daneren2005/dsub/util/ImageLoader.java +++ b/src/github/daneren2005/dsub/util/ImageLoader.java @@ -110,7 +110,16 @@ public class ImageLoader { color = COLORS[0]; } else { key = getKey(entry.getId() + "unknown", size); - color = COLORS[Math.abs(entry.getAlbum().hashCode()) % COLORS.length]; + + String hash; + if(entry.getAlbum() != null) { + hash = entry.getAlbum(); + } else if(entry.getArtist() != null) { + hash = entry.getArtist(); + } else { + hash = entry.getId(); + } + color = COLORS[Math.abs(hash.hashCode()) % COLORS.length]; } Bitmap bitmap = cache.get(key); if(bitmap == null) { -- cgit v1.2.3 From dcaca5481f71838a271c100e99821023d31061ba Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 27 Dec 2014 21:52:59 -0800 Subject: Dsub 4.8.6 Re-release --- AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 5aa88311..653644e0 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,7 +2,7 @@