Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
DO NOT MERGE - Prevent NPE when account sender name is null
Browse files Browse the repository at this point in the history
Bug: 3500373
Backport of: Id07270f34d9cc0523c46104b3167711b71798623

Change-Id: I23464e3edd9c8d8ecc54451cf7eabfddb73bd745
  • Loading branch information
andrewstadler committed Mar 25, 2011
1 parent 8f0a79c commit 9258827
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/com/android/email/activity/setup/AccountSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
});

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();
Expand Down

0 comments on commit 9258827

Please sign in to comment.