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:
parent
1c75590e7a
commit
9118097dcb
@ -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 */ }
|
||||||
|
Loading…
Reference in New Issue
Block a user