diff options
author | Jay Shrauner <shrauner@google.com> | 2014-01-30 12:21:01 -0800 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2014-03-01 20:14:48 +0000 |
commit | 1e090bfaee34b45e1127dc1549bae1d60ca75b66 (patch) | |
tree | eef190baa05a0557491907d7e4839c688816b02b | |
parent | 49a9c120b0b6e3942bc950143f1e2970c8ff374a (diff) | |
download | android_packages_apps_Contacts-1e090bfaee34b45e1127dc1549bae1d60ca75b66.tar.gz android_packages_apps_Contacts-1e090bfaee34b45e1127dc1549bae1d60ca75b66.tar.bz2 android_packages_apps_Contacts-1e090bfaee34b45e1127dc1549bae1d60ca75b66.zip |
Fix NPE on non decodable Bitmap
Fix so don't crash if unable to decode Bitmap that user is attempting to
assign to a contact.
Bug:12819739
Change-Id: I34f31b1e84a76a15d4de92ccd5544ff502743079
(cherry picked from commit 5d170911503c81aca63a9a089aeb0c5664ef0487)
-rw-r--r-- | src/com/android/contacts/activities/AttachPhotoActivity.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/contacts/activities/AttachPhotoActivity.java b/src/com/android/contacts/activities/AttachPhotoActivity.java index 2d9e9f578..e25bef2a4 100644 --- a/src/com/android/contacts/activities/AttachPhotoActivity.java +++ b/src/com/android/contacts/activities/AttachPhotoActivity.java @@ -223,6 +223,10 @@ public class AttachPhotoActivity extends ContactsActivity { Log.w(TAG, "Could not find bitmap"); return; } + if (bitmap == null) { + Log.w(TAG, "Could not decode bitmap"); + return; + } final Bitmap scaled = Bitmap.createScaledBitmap(bitmap, size, size, false); final byte[] compressed = ContactPhotoUtils.compressBitmap(scaled); |