Skip to content

Commit

Permalink
Fix Cannot retrieve the required profile information (NPE)
Browse files Browse the repository at this point in the history
  • Loading branch information
creekorful committed Nov 5, 2020
1 parent 3f45009 commit 0b3e70f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 61 deletions.
123 changes: 64 additions & 59 deletions idisguise-impl-v1_8_R3/pom.xml
Original file line number Diff line number Diff line change
@@ -1,60 +1,65 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.robingrether.idisguise</groupId>
<artifactId>idisguise-impl-v1_8_R3</artifactId>
<version>5.8.2</version>
<name>iDisguise Implementation 1.8 R3</name>

<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>robingrether-repo</id>
<url>http://repo.robingrether.de/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.robingrether.idisguise</groupId>
<artifactId>idisguise-core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.1.0</version>
</extension>
</extensions>
</build>

<distributionManagement>
<repository>
<id>robingrether-repository-ftp</id>
<url>sftp://ssh.strato.de/</url>
</repository>
</distributionManagement>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.robingrether.idisguise</groupId>
<artifactId>idisguise-impl-v1_8_R3</artifactId>
<version>5.8.2</version>
<name>iDisguise Implementation 1.8 R3</name>

<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>robingrether-repo</id>
<url>http://repo.robingrether.de/</url>
</repository>
<repository>
<id>elmakers-repo</id>
<url>http://maven.elmakers.com/repository/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.robingrether.idisguise</groupId>
<artifactId>idisguise-core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.1.0</version>
</extension>
</extensions>
</build>

<distributionManagement>
<repository>
<id>robingrether-repository-ftp</id>
<url>sftp://ssh.strato.de/</url>
</repository>
</distributionManagement>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.stream.Collectors;

import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
Expand Down Expand Up @@ -119,7 +120,7 @@ private void loadGameProfile(UUID uniqueId, String name) {
connection.connect();
if(connection.getResponseCode() == 200) {
reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String response = reader.readLine();
String response = reader.lines().collect(Collectors.joining());
JSONObject object = (JSONObject)JSONValue.parse(response);
name = (String)object.get(API_UID_NAME);
profile = new GameProfile(uniqueId, name);
Expand Down Expand Up @@ -260,4 +261,4 @@ public void waitForGameProfile(String name) {
}
}

}
}

0 comments on commit 0b3e70f

Please sign in to comment.