From ad1d181cd21ee598512c142150e79be754209548 Mon Sep 17 00:00:00 2001 From: Scott Kennedy Date: Mon, 29 Jul 2013 19:59:06 -0700 Subject: Don't bother storing a null value in the cache It serves very little purpose, and it causes an NPE. Bug: 9286049 Change-Id: I8c95d8ded2bebdc9b904ef788cbc70865144213e --- chips/src/com/android/ex/chips/BaseRecipientAdapter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chips/src/com/android/ex/chips/BaseRecipientAdapter.java b/chips/src/com/android/ex/chips/BaseRecipientAdapter.java index 71b610e..a9aee46 100644 --- a/chips/src/com/android/ex/chips/BaseRecipientAdapter.java +++ b/chips/src/com/android/ex/chips/BaseRecipientAdapter.java @@ -765,8 +765,10 @@ public abstract class BaseRecipientAdapter extends BaseAdapter implements Filter mHandler.post(new Runnable() { @Override public void run() { - mPhotoCacheMap.put(photoThumbnailUri, photoBytes); - notifyDataSetChanged(); + if (photoBytes != null) { + mPhotoCacheMap.put(photoThumbnailUri, photoBytes); + notifyDataSetChanged(); + } } }); } -- cgit v1.2.3