summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Kennedy <skennedy@google.com>2013-07-29 19:59:06 -0700
committerScott Kennedy <skennedy@google.com>2013-07-29 20:02:40 -0700
commitad1d181cd21ee598512c142150e79be754209548 (patch)
tree7a6b10bb2527daf4e9632f78d5c8b74e74d41c00
parentb5e0079419300f09253f160e0bdd28aa1bef4605 (diff)
downloadandroid_frameworks_ex-ad1d181cd21ee598512c142150e79be754209548.tar.gz
android_frameworks_ex-ad1d181cd21ee598512c142150e79be754209548.tar.bz2
android_frameworks_ex-ad1d181cd21ee598512c142150e79be754209548.zip
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
-rw-r--r--chips/src/com/android/ex/chips/BaseRecipientAdapter.java6
1 files 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();
+ }
}
});
}