diff options
author | calderwoodra <calderwoodra@google.com> | 2017-07-18 16:49:49 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-25 16:42:37 +0000 |
commit | 09b15491c67ac56d344a70309dc7b9c19de0ded2 (patch) | |
tree | 211e0c2d0b70bdb5362a4e27a052cf86dea0bf5c /java/com/android/dialer/contactsfragment/ContactsAdapter.java | |
parent | cf6b73283318a3e35f3483581bdde5a0766bd72b (diff) |
Contacts adapter now checks if cursor is closed.
Bug: 63696987
Test: ContactsAdapterTest
PiperOrigin-RevId: 162423318
Change-Id: Ia43bda7857576b4e838372eef79edb1fa233571f
Diffstat (limited to 'java/com/android/dialer/contactsfragment/ContactsAdapter.java')
-rw-r--r-- | java/com/android/dialer/contactsfragment/ContactsAdapter.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/java/com/android/dialer/contactsfragment/ContactsAdapter.java b/java/com/android/dialer/contactsfragment/ContactsAdapter.java index 6b9374c07..1bd8e343a 100644 --- a/java/com/android/dialer/contactsfragment/ContactsAdapter.java +++ b/java/com/android/dialer/contactsfragment/ContactsAdapter.java @@ -137,7 +137,7 @@ final class ContactsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder @Override public int getItemCount() { - return (cursor == null ? 0 : cursor.getCount()) + 1; // add contact + return (cursor == null || cursor.isClosed() ? 0 : cursor.getCount()) + 1; // add contact } private static String getDisplayName(Cursor cursor) { |