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,10 +238,12 @@ public class ContactPictureLoader {
if (stream != null) { if (stream != null) {
try { try {
Bitmap tempBitmap = BitmapFactory.decodeStream(stream); Bitmap tempBitmap = BitmapFactory.decodeStream(stream);
bitmap = Bitmap.createScaledBitmap(tempBitmap, mPictureSizeInPx, if (tempBitmap != null) {
mPictureSizeInPx, true); bitmap = Bitmap.createScaledBitmap(tempBitmap, mPictureSizeInPx,
if (tempBitmap != bitmap) { mPictureSizeInPx, true);
tempBitmap.recycle(); if (tempBitmap != bitmap) {
tempBitmap.recycle();
}
} }
} finally { } finally {
try { stream.close(); } catch (IOException e) { /* ignore */ } try { stream.close(); } catch (IOException e) { /* ignore */ }