commit | 9c956333630713229f65e5d9d66dc731f8d8b335 | [log] [tgz] |
---|---|---|
author | Saša Živkov <sasa.zivkov@sap.com> | Thu Jun 06 17:04:58 2019 +0200 |
committer | Saša Živkov <sasa.zivkov@sap.com> | Thu Jun 06 17:06:19 2019 +0200 |
tree | 586fba37ff9b2f938fd847466a22672029a4c059 | |
parent | 8f45657b9a39757f73c345bdab9b6b60d8a3c9fd [diff] |
Fix another java.util.NoSuchElementException: No value present The If6c227d5134f81e7604b13800f90f785fa2ad206 fixed only one such place in the code. Bug: Issue 9820 Change-Id: Ifc175c499c5956a008e0e018871c4ecdd7d93335
diff --git a/src/main/java/com/googlesource/gerrit/plugins/avatars/external/ExternalUrlAvatarProvider.java b/src/main/java/com/googlesource/gerrit/plugins/avatars/external/ExternalUrlAvatarProvider.java index fdac920..dd03c91 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/avatars/external/ExternalUrlAvatarProvider.java +++ b/src/main/java/com/googlesource/gerrit/plugins/avatars/external/ExternalUrlAvatarProvider.java
@@ -99,7 +99,7 @@ @Override public String getChangeAvatarUrl(IdentifiedUser forUser) { String userReplacedAvatarChangeURL = replaceInUrl(USER_PLACEHOLDER, - avatarChangeUrl, forUser.getUserName().get()); + avatarChangeUrl, forUser.getUserName().orElse(null)); return replaceInUrl(EMAIL_PLACEHOLDER, userReplacedAvatarChangeURL, forUser.getAccount().getPreferredEmail()); }