diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-08-13 19:56:41 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-08-13 19:56:41 +0200 |
commit | d94d0645102984fec48a72fe39ee5d380fae089a (patch) | |
tree | 13de6ddf339130ba9da42943e387f08a419daa79 /src | |
parent | cf1e9cb59b05ab35523467b208d99a3cae97e9fd (diff) | |
download | AntennaPod-d94d0645102984fec48a72fe39ee5d380fae089a.zip |
Fixed NullpointerException in PicassoProvider
Diffstat (limited to 'src')
-rw-r--r-- | src/de/danoeh/antennapod/asynctask/PicassoProvider.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/de/danoeh/antennapod/asynctask/PicassoProvider.java b/src/de/danoeh/antennapod/asynctask/PicassoProvider.java index 54aa3178c..849725630 100644 --- a/src/de/danoeh/antennapod/asynctask/PicassoProvider.java +++ b/src/de/danoeh/antennapod/asynctask/PicassoProvider.java @@ -133,13 +133,16 @@ public class PicassoProvider { } else { // check for fallback Uri - String fallback = Uri.decode(Uri.parse(uri.getQueryParameter(PicassoImageResource.PARAM_FALLBACK)).getPath()); - if (fallback != null) { - File imageFile = new File(fallback); - return new Response(new BufferedInputStream(new FileInputStream(imageFile)), true, imageFile.length()); - } else { - return null; + String fallbackParam = uri.getQueryParameter(PicassoImageResource.PARAM_FALLBACK); + + if (fallbackParam != null) { + String fallback = Uri.decode(Uri.parse(fallbackParam).getPath()); + if (fallback != null) { + File imageFile = new File(fallback); + return new Response(new BufferedInputStream(new FileInputStream(imageFile)), true, imageFile.length()); + } } + return null; } } } |