Fix NPE for Mojang API connector

This commit is contained in:
games647
2017-10-03 15:14:37 +02:00
parent 0f01002564
commit 6daa654af8
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,9 @@
### 1.11
* Optimize issue template
* Use Instant for timestamps
* Migrate SLF4J logging (Fixes #177)
* Use Gson's TypeAdapter for more type safety
* Add support for IPv6 proxies
* Shared configuration implementation for easier maintained code
* Use Gson for json parsing, because it's supported on all platforms and removes code duplicates

View File

@ -22,6 +22,7 @@ import java.net.URL;
import java.net.UnknownHostException;
import java.time.Duration;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@ -55,7 +56,7 @@ public class MojangApiConnector {
private final SSLSocketFactory sslFactory;
private final int rateLimit;
private Instant lastRateLimit;
private Instant lastRateLimit = Instant.now().minus(10, ChronoUnit.MINUTES);
protected final Gson gson = new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create();
protected final Logger logger;