Fix possible NPE in ContactPhotoManager.
It may put null to LRUCache when input has some problem.
Reported via public issue tracker (issue 18369)
Bug: 5447001
Change-Id: Icee410d2a999af3aae828b5a0eb61fb9b5c7db99
diff --git a/src/com/android/contacts/ContactPhotoManager.java b/src/com/android/contacts/ContactPhotoManager.java
index e04a07a..7b54666 100644
--- a/src/com/android/contacts/ContactPhotoManager.java
+++ b/src/com/android/contacts/ContactPhotoManager.java
@@ -359,8 +359,10 @@
view.setImageBitmap(holder.bitmap);
- // Put the bitmap in the LRU cache
- mBitmapCache.put(request, holder.bitmap);
+ if (holder.bitmap != null) {
+ // Put the bitmap in the LRU cache
+ mBitmapCache.put(request, holder.bitmap);
+ }
// Soften the reference
holder.bitmap = null;