Fix crash when adding a new contact
Check if mRawContacts is not null before trying to save it into
outState in onSaveInstanceState. If it is not null, save an
empty arraylist instead.
Bug: 8018115
Change-Id: I14db6bad22707b5154ffe016d2fd3b4391c13c85
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index da0d91e..464ac9d 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -1661,7 +1661,9 @@
outState.putBoolean(KEY_IS_EDIT, mIsEdit);
outState.putBoolean(KEY_NEW_CONTACT_READY, mNewContactDataReady);
outState.putBoolean(KEY_EXISTING_CONTACT_READY, mExistingContactDataReady);
- outState.putParcelableArrayList(KEY_RAW_CONTACTS, Lists.newArrayList(mRawContacts));
+ outState.putParcelableArrayList(KEY_RAW_CONTACTS,
+ mRawContacts == null ?
+ Lists.<RawContact> newArrayList() : Lists.newArrayList(mRawContacts));
super.onSaveInstanceState(outState);
}