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

Commit b5a72b0e authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 20945

* changes:
  contrary to popular belief ContentResolver.query can return null. so check.
parents 44487404 93187560
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
            c = mContentResolver.query(Uri.withAppendedPath(
                    RawContacts.CONTENT_FILTER_EMAIL_URI, Uri.encode(emailAddress)),
                    EMAIL_LOOKUP_PROJECTION, null, null, null);
            if (c.moveToFirst()) {
            if (c != null && c.moveToFirst()) {
                long contactId = c.getLong(EMAIL_LOOKUP_CONTACT_ID_COLUMN_INDEX);
                bindFromContactId(contactId);
            } else {
@@ -296,7 +296,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
        try {
            c = mContentResolver.query(Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, number),
                    PHONE_LOOKUP_PROJECTION, null, null, null);
            if (c.moveToFirst()) {
            if (c != null && c.moveToFirst()) {
                long contactId = c.getLong(PHONE_LOOKUP_CONTACT_ID_COLUMN_INDEX);
                bindFromContactId(contactId);
            } else {
@@ -408,7 +408,7 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
                    new String[] { Photo.PHOTO },
                    null, null, null);

            if (photoCursor.moveToFirst() && !photoCursor.isNull(0)) {
            if (photoCursor != null && photoCursor.moveToFirst() && !photoCursor.isNull(0)) {
                byte[] photoData = photoCursor.getBlob(0);
                photoBm = BitmapFactory.decodeByteArray(photoData, 0,
                        photoData.length, options);