commit | ab79a268ad8f113f0bc76ee410e6b804cdaa44ef | [log] [tgz] |
---|---|---|
author | Jesse Wilson <jessewilson@google.com> | Wed Feb 09 15:34:31 2011 -0800 |
committer | Jesse Wilson <jessewilson@google.com> | Wed Feb 09 15:34:55 2011 -0800 |
tree | 360e159239915b062a78ca099230b4c3cc841b22 | |
parent | e353e666d18f49807f5a59d357971ead3a2b95e7 [diff] [blame] |
Handle null byte array in contacts cache. http://b/3438334 Change-Id: Id391bcd4564ac10dc4970609eb9382c7500a3778
diff --git a/src/com/android/contacts/ContactPhotoManager.java b/src/com/android/contacts/ContactPhotoManager.java index 7f1387d..914b697 100644 --- a/src/com/android/contacts/ContactPhotoManager.java +++ b/src/com/android/contacts/ContactPhotoManager.java
@@ -210,7 +210,7 @@ int maxBytes = resources.getInteger(R.integer.config_photo_cache_max_bytes); mBitmapHolderCache = new LruCache<Object, BitmapHolder>(maxBytes) { @Override protected int sizeOf(Object key, BitmapHolder value) { - return value.bytes.length; + return value.bytes != null ? value.bytes.length : 0; } }; mBitmapHolderCacheRedZoneBytes = (int) (maxBytes * 0.75);