PNG handling with NPE check first

This commit is contained in:
Andy Scherzinger 2016-06-25 15:06:32 +02:00
parent 5c44ea5884
commit a466cfd109

View file

@ -485,10 +485,10 @@ public class ThumbnailsCacheManager {
InputStream inputStream = get.getResponseBodyAsStream();
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
avatar = ThumbnailUtils.extractThumbnail(bitmap, px, px);
avatar = handlePNG(avatar, px);
// Add avatar to cache
if (avatar != null) {
avatar = handlePNG(avatar, px);
addBitmapToCache(imageKey, avatar);
}
} else {