diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-06-23 20:05:12 -0400 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-06-23 20:05:12 -0400 |
commit | f2dd49d533475a9486ed00ba88abf30489b59519 (patch) | |
tree | 3e1222b240d94a9c64aa170b9aa7c4961ab19f64 | |
parent | 5e8c75a1da7375cd5a48902e6bd0bc5d175d0001 (diff) | |
download | AntennaPod-f2dd49d533475a9486ed00ba88abf30489b59519.zip |
Return NULL instead of result when unable to load bitmap.
There are still cases where 'bitmap' could be null.
We shouldn't return a result when that's the case.
Returnning null appears to be supported by Picasso.
(see Picasso.NetworkRequestHandler)
Fixes AntennaPod/AntennaPod#947
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java index 09fe0d654..8e47a5b71 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/PicassoProvider.java @@ -170,6 +170,12 @@ public class PicassoProvider { bitmap = decodeStreamFromFile(data, fallback); } } + + if (bitmap == null) { + Log.e(TAG, "Could not load media"); + return null; + } + return new Result(bitmap, Picasso.LoadedFrom.DISK); } |