From 3945fb2fd967254518ede49aa879a091e0ab9141 Mon Sep 17 00:00:00 2001 From: Tom Hennen Date: Thu, 18 Jun 2015 18:29:58 -0400 Subject: [PATCH] Fallback for picasso even if we think it's impossible. Fixes AntennaPod/AntennaPod#891 --- .../danoeh/antennapod/core/asynctask/PicassoProvider.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 e454cec7d..246adb4c1 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 @@ -162,6 +162,14 @@ public class PicassoProvider { } if (bitmap == null) { + // this should never, happen, but sometimes it does, so fallback + // check for fallback Uri + String fallbackParam = data.uri.getQueryParameter(PicassoImageResource.PARAM_FALLBACK); + if (fallbackParam != null) { + Uri fallback = Uri.parse(fallbackParam); + bitmap = decodeStreamFromFile(data, fallback); + } + Log.wtf(TAG, "THIS SHOULD NEVER EVER HAPPEN!!"); } return new Result(bitmap, Picasso.LoadedFrom.DISK);