Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8cca7b7 authored by Maurice Chu's avatar Maurice Chu Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE due to uncomputed formatted phone numbers" into jb-mr1-dev

parents 377cabd4 a9b09d5c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -573,6 +573,15 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen
                    PhoneDataItem phone = (PhoneDataItem) dataItem;
                    // Build phone entries
                    entry.data = phone.getFormattedPhoneNumber();
                    if (entry.data == null) {
                        // This case happens when the quick contact was opened from the contact
                        // list, and then, the user touches the quick contact image and brings the
                        // user to the detail card.  In this case, the Contact object that was
                        // loaded from quick contacts does not contain the formatted phone number,
                        // so it must be loaded here.
                        phone.computeFormattedPhoneNumber(mDefaultCountryIso);
                        entry.data = phone.getFormattedPhoneNumber();
                    }
                    final Intent phoneIntent = mHasPhone ?
                            ContactsUtils.getCallIntent(entry.data) : null;
                    final Intent smsIntent = mHasSms ? new Intent(Intent.ACTION_SENDTO,