1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Avoid NullPointerException when decoding contact pictures

This commit is contained in:
cketti 2013-03-19 02:59:05 +01:00
parent 1c75590e7a
commit 9118097dcb

View File

@ -238,11 +238,13 @@ public class ContactPictureLoader {
if (stream != null) {
try {
Bitmap tempBitmap = BitmapFactory.decodeStream(stream);
if (tempBitmap != null) {
bitmap = Bitmap.createScaledBitmap(tempBitmap, mPictureSizeInPx,
mPictureSizeInPx, true);
if (tempBitmap != bitmap) {
tempBitmap.recycle();
}
}
} finally {
try { stream.close(); } catch (IOException e) { /* ignore */ }
}