mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-12 04:25:08 -05:00
Avoid NullPointerException when decoding contact pictures
This commit is contained in:
parent
1c75590e7a
commit
9118097dcb
@ -238,10 +238,12 @@ public class ContactPictureLoader {
|
||||
if (stream != null) {
|
||||
try {
|
||||
Bitmap tempBitmap = BitmapFactory.decodeStream(stream);
|
||||
bitmap = Bitmap.createScaledBitmap(tempBitmap, mPictureSizeInPx,
|
||||
mPictureSizeInPx, true);
|
||||
if (tempBitmap != bitmap) {
|
||||
tempBitmap.recycle();
|
||||
if (tempBitmap != null) {
|
||||
bitmap = Bitmap.createScaledBitmap(tempBitmap, mPictureSizeInPx,
|
||||
mPictureSizeInPx, true);
|
||||
if (tempBitmap != bitmap) {
|
||||
tempBitmap.recycle();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try { stream.close(); } catch (IOException e) { /* ignore */ }
|
||||
|
Loading…
Reference in New Issue
Block a user