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

Commit 87270e1b authored by Josh Gargus's avatar Josh Gargus
Browse files

Avoid crash when re-saving new contact with photo.

This bug was encountered when creating a new contact from Maps,
but could happen any time you:
- create a new contact
- set a contact photo, either from the gallery or a new photo
- save contact but don't leave ContactEditorFragment
  (eg: "Join" cause the contact to be saved)
- edit another field
- save

The fix is to clear the list of photos-to-save after each save.

Bug: 6432438
Change-Id: I63e86bd82fd16b8177bdca741ecc7a1a90d22d18
parent fead956d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1027,8 +1027,11 @@ public class ContactEditorFragment extends Fragment implements
        Intent intent = ContactSaveService.createSaveContactIntent(getActivity(), mState,
                SAVE_MODE_EXTRA_KEY, saveMode, isEditingUserProfile(), getActivity().getClass(),
                ContactEditorActivity.ACTION_SAVE_COMPLETED, mUpdatedPhotos);

        getActivity().startService(intent);

        // Don't try to save the same photos twice.
        mUpdatedPhotos = new Bundle();

        return true;
    }