aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2020-09-12 10:52:34 -0700
committerScott Jackson <daneren2005@gmail.com>2020-09-12 10:52:34 -0700
commit5cc7156fee13d8318bad59b76edca8b0d844a18c (patch)
tree809f177fa751d0c05f5962acd8ca20fa2e0d3ba2 /app
parent85194adc64c211fd9e7c0b2de57b16366f39f98d (diff)
downloaddsub-5cc7156fee13d8318bad59b76edca8b0d844a18c.tar.gz
dsub-5cc7156fee13d8318bad59b76edca8b0d844a18c.tar.bz2
dsub-5cc7156fee13d8318bad59b76edca8b0d844a18c.zip
Fix hard crash when storage issues are preventing saving/loading stuff
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java b/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java
index 23f48e02..00858f9c 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java
@@ -207,8 +207,10 @@ public class ImageLoader {
if(bitmap == null || bitmap.isRecycled()) {
bitmap = FileUtil.getAlbumArtBitmap(context, entry, size);
String key = getKey(entry.getCoverArt(), size);
- cache.put(key, bitmap);
- cache.get(key);
+ if(key != null && bitmap != null) {
+ cache.put(key, bitmap);
+ cache.get(key);
+ }
}
if(bitmap != null && bitmap.isRecycled()) {