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

Commit 8407c932 authored by blong's avatar blong
Browse files

Fix NullPointerException when set profile photo

- Add null judge when get rawcontactdelta.

Bug : 62688231

Change-Id: I31e5716fd48e7e559adb74b961f147804af6f7e0
parent a33aca87
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -945,8 +945,10 @@ public class ContactEditorFragment extends Fragment implements
        if (isEditingReadOnlyRawContactWithNewContact()) {
            // We created a new raw contact delta with a default display name.
            // We must test for pending changes while ignoring the default display name.
            final ValuesDelta beforeDelta = mState.getByRawContactId(mReadOnlyDisplayNameId)
                    .getSuperPrimaryEntry(StructuredName.CONTENT_ITEM_TYPE);
            final RawContactDelta beforeRawContactDelta = mState
                    .getByRawContactId(mReadOnlyDisplayNameId);
            final ValuesDelta beforeDelta = beforeRawContactDelta == null ? null :
                  beforeRawContactDelta.getSuperPrimaryEntry(StructuredName.CONTENT_ITEM_TYPE);
            final ValuesDelta pendingDelta = mState
                    .getSuperPrimaryEntry(StructuredName.CONTENT_ITEM_TYPE);
            if (structuredNamesAreEqual(beforeDelta, pendingDelta)) {