From 9295405d7cdc6e97bbebce485710aafb8704c198 Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Fri, 8 Sep 2017 10:55:04 -0700 Subject: Fix NPE in contacts fragment. Bug: 64716624 Test: manual PiperOrigin-RevId: 168017541 Change-Id: Ia8e581f19a0a9c4d45bacc4ab94e54131763640a --- java/com/android/dialer/contactsfragment/ContactsFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/com/android/dialer/contactsfragment/ContactsFragment.java b/java/com/android/dialer/contactsfragment/ContactsFragment.java index ddf00b358..7d2097692 100644 --- a/java/com/android/dialer/contactsfragment/ContactsFragment.java +++ b/java/com/android/dialer/contactsfragment/ContactsFragment.java @@ -179,7 +179,7 @@ public class ContactsFragment extends Fragment @Override public void onLoadFinished(Loader loader, Cursor cursor) { - if (cursor.getCount() == 0) { + if (cursor == null || cursor.getCount() == 0) { emptyContentView.setDescription(R.string.all_contacts_empty); emptyContentView.setActionLabel(R.string.all_contacts_empty_add_contact_action); emptyContentView.setVisibility(View.VISIBLE); -- cgit v1.2.3