commit | ff62773c066617339241fabca62c92b4b2491a47 | [log] [tgz] |
---|---|---|
author | Jay Shrauner <shrauner@google.com> | Tue Nov 25 14:54:59 2014 -0800 |
committer | Jay Shrauner <shrauner@google.com> | Tue Nov 25 14:54:59 2014 -0800 |
tree | 78629e4674820ae94daba6f1e12d0c7055ae0eda | |
parent | 7133e7c4f1897baffde0f9690c5b810b30deed91 [diff] |
Fix cursor exception in changeCursor Check for return value of cursor.moveToFirst() to prevent a CursorIndexOutOfBoundsException when reading from the cursor. Bug:18526371 Change-Id: I3d6b180d6794921f13137823ab5b5a22fdd6c128
diff --git a/src/com/android/contacts/common/list/ContactListAdapter.java b/src/com/android/contacts/common/list/ContactListAdapter.java index 7e9a2e9..9107d04 100644 --- a/src/com/android/contacts/common/list/ContactListAdapter.java +++ b/src/com/android/contacts/common/list/ContactListAdapter.java
@@ -350,8 +350,7 @@ super.changeCursor(partitionIndex, cursor); // Check if a profile exists - if (cursor != null && cursor.getCount() > 0) { - cursor.moveToFirst(); + if (cursor != null && cursor.moveToFirst()) { setProfileExists(cursor.getInt(ContactQuery.CONTACT_IS_USER_PROFILE) == 1); } }