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
This commit is contained in:
Tom Hennen 2015-06-23 20:05:12 -04:00
parent 5e8c75a1da
commit f2dd49d533
1 changed files with 6 additions and 0 deletions

View File

@ -170,6 +170,12 @@ public class PicassoProvider {
bitmap = decodeStreamFromFile(data, fallback); bitmap = decodeStreamFromFile(data, fallback);
} }
} }
if (bitmap == null) {
Log.e(TAG, "Could not load media");
return null;
}
return new Result(bitmap, Picasso.LoadedFrom.DISK); return new Result(bitmap, Picasso.LoadedFrom.DISK);
} }