diff --git a/src/com/android/email/activity/setup/AccountSettingsFragment.java b/src/com/android/email/activity/setup/AccountSettingsFragment.java index adbf88970..f82da2890 100644 --- a/src/com/android/email/activity/setup/AccountSettingsFragment.java +++ b/src/com/android/email/activity/setup/AccountSettingsFragment.java @@ -381,8 +381,11 @@ public class AccountSettingsFragment extends PreferenceFragment { ); mAccountName = (EditTextPreference) findPreference(PREFERENCE_NAME); - mAccountName.setSummary(mAccount.getSenderName()); - mAccountName.setText(mAccount.getSenderName()); + String senderName = mAccount.getSenderName(); + // In rare cases, sendername will be null; Change this to empty string to avoid NPE's + if (senderName == null) senderName = ""; + mAccountName.setSummary(senderName); + mAccountName.setText(senderName); mAccountName.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { public boolean onPreferenceChange(Preference preference, Object newValue) { final String summary = newValue.toString().trim();