Browse Source

fix: eliminate the possibility of NullPointerException (#56)

* fix: eliminate the possibility of NullPointerException 
* build: fix release build

---------

Co-authored-by: Ryan Peper <ryan.peper@outlook.com>
master
Hiroyuki Wada 2 months ago
committed by GitHub
parent
commit
e2b5991c7e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      .releaserc
  2. 7
      pom.xml
  3. 6
      src/main/java/org/keycloak/social/discord/DiscordIdentityProvider.java

2
.releaserc

@ -9,7 +9,7 @@
[
"@terrestris/maven-semantic-release",
{
"mavenTarget": "install",
"mavenTarget": "deploy",
"clean": false,
"updateSnapshotVersion": true,
"settingsPath": "/home/runner/.m2/settings.xml",

7
pom.xml

@ -52,6 +52,13 @@
<target>17</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.3</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

6
src/main/java/org/keycloak/social/discord/DiscordIdentityProvider.java

@ -71,9 +71,11 @@ public class DiscordIdentityProvider extends AbstractOAuth2IdentityProvider<Disc
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);

Loading…
Cancel
Save