Files
gerrit/gerrit-server
David Pursehouse d75352f042 OutgoingEmail#getNameEmailFor: Protect against null accountId
If the accountId is null, it results in a NullPointerException when
attempting to get the account from the account cache:

  at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:782)
  at com.google.common.cache.LocalCache.get(LocalCache.java:4146)
  at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
  at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
  at com.google.gerrit.server.account.AccountCacheImpl.get(AccountCacheImpl.java:85)

Check for null, and return the name and email address of the server
identity, consistently with what #getNameFor does when the accountId
is null. Update the Javadoc accordingly.

Also update the Javadoc of #getNameFor to make it consistent.

Change-Id: I8145ca79d2122616247b013f83ded50db1f30f62
2018-06-20 14:18:46 +09:00
..