diff options
author | Daniel Lehmann <lehmannd@google.com> | 2010-03-19 15:21:05 -0700 |
---|---|---|
committer | Daniel Lehmann <lehmannd@google.com> | 2010-03-19 15:21:05 -0700 |
commit | d4d73e2df19f8304f9eb9426319b182931a25a9e (patch) | |
tree | 1eeeec6478c46a09107c0766c0ae1e001247b805 | |
parent | 73f1f396c155b247b903d8f4111db17d3e13dc4d (diff) | |
download | ContactsProvider-d4d73e2df19f8304f9eb9426319b182931a25a9e.tar.gz |
Handle account==null instead of throwing NullPointerException
Bug:2528419
Change-Id: I30bbdc5fcc8d1259c36bfe04badf32e3e034d1f3
-rw-r--r-- | src/com/android/providers/contacts/ContactAggregator.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/providers/contacts/ContactAggregator.java b/src/com/android/providers/contacts/ContactAggregator.java index 88270c19..de55f93a 100644 --- a/src/com/android/providers/contacts/ContactAggregator.java +++ b/src/com/android/providers/contacts/ContactAggregator.java @@ -1206,10 +1206,10 @@ public class ContactAggregator { // For now, just choose the first photo in a list sorted by account name. String account = c.getString(RawContactsQuery.ACCOUNT_NAME); - if (!foundSuperPrimaryPhoto - && (superprimary - || photoAccount == null - || photoAccount.compareToIgnoreCase(account) >= 0)) { + if (!foundSuperPrimaryPhoto && ( + superprimary || photoAccount == null || + (account != null && + photoAccount.compareToIgnoreCase(account) >= 0))) { photoAccount = account; bestPhotoId = dataId; foundSuperPrimaryPhoto |= superprimary; |