Add null check to Uri when getting the name to toast

When all contact details are removed from a contact when there are
no accounts (potentially if it's the device account) the contact is
fully deleted, so the Uri is null when we try to get the name to
display. Bail early and return null in this case.

Test: Verified no crash and consistent behavior with previous releases
when removing all contact info from a contact when no accounts are
present and when deleting all info from the ME profile with Google+
contacts sync turned off.

Bug: 32982336
Change-Id: I0fd236080750a5040a5c9ffd80a48a37cb1f8ae3
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 526799c..1a1295b 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -1378,6 +1378,10 @@
 
 
     private String getNameToDisplay(Uri contactUri) {
+        // The contact has been deleted or the uri is otherwise no longer right.
+        if (contactUri == null) {
+            return null;
+        }
         final ContentResolver resolver = mContext.getContentResolver();
         final Cursor cursor = resolver.query(contactUri, new String[]{
                 ContactsContract.Contacts.DISPLAY_NAME,