OutgoingEmail#getUserNameEmailFor: Protect against null accountId

If the accountId is null, just return null.

Change-Id: Ibb6994a5b137fc898e54eef11d676fec35a1fad7
This commit is contained in:
David Pursehouse
2018-06-20 10:36:06 +09:00
parent d75352f042
commit aac761785b

View File

@@ -378,6 +378,9 @@ public abstract class OutgoingEmail {
* @return name/email of account, username, or null if unset.
*/
public String getUserNameEmailFor(Account.Id accountId) {
if (accountId == null) {
return null;
}
AccountState who = args.accountCache.get(accountId);
String name = who.getAccount().getFullName();
String email = who.getAccount().getPreferredEmail();