commit | 5d170911503c81aca63a9a089aeb0c5664ef0487 | [log] [tgz] |
---|---|---|
author | Jay Shrauner <shrauner@google.com> | Thu Jan 30 12:21:01 2014 -0800 |
committer | Jay Shrauner <shrauner@google.com> | Thu Jan 30 12:21:01 2014 -0800 |
tree | 6582a5d567725e5981eeb7c187709916c2fe5315 | |
parent | 13c42f4ebb1c7f31750262946ce3b390c93d5320 [diff] |
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
diff --git a/src/com/android/contacts/activities/AttachPhotoActivity.java b/src/com/android/contacts/activities/AttachPhotoActivity.java index 23c5398..f70bc7e 100644 --- a/src/com/android/contacts/activities/AttachPhotoActivity.java +++ b/src/com/android/contacts/activities/AttachPhotoActivity.java
@@ -224,6 +224,10 @@ 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);