Skip to content

Commit

Permalink
Merge pull request #55 from wadahiro/rpeper-conditional-discriminator
Browse files Browse the repository at this point in the history
fix: eliminate the possibility of NullPointerException
  • Loading branch information
wadahiro authored Nov 2, 2024
2 parents 5c0a0d7 + b8a84df commit ac7d0e3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event,

String username = getJsonProperty(profile, "username");
String discriminator = getJsonProperty(profile, "discriminator");
if (!discriminator.equals("0")) {
username = username + "#" + discriminator;

if (!"0".equals(discriminator)) {
username += "#" + discriminator;
}

user.setUsername(username);
user.setEmail(getJsonProperty(profile, "email"));
user.setIdp(this);
Expand Down

0 comments on commit ac7d0e3

Please sign in to comment.