From f036462d5b4d4398c0187c81f219cbcb8813b665 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 31 Jul 2018 01:37:41 -0400 Subject: [PATCH] PlayerProfile.complete shouldn't throw NPE We have a result boolean for this already, and this method was meant to be "Try from cache, if that fails, look it up" So NPE'ing there just wasn't correct. --- .../Basic-PlayerProfile-API.patch | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch index 80fb517035..2d65cc4833 100644 --- a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch @@ -7,7 +7,7 @@ Establishes base extension of profile systems for future edits too diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java new file mode 100644 -index 000000000..9ad5853de +index 0000000000..b151a13c1b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java @@ -0,0 +0,0 @@ @@ -166,10 +166,9 @@ index 000000000..9ad5853de + // Make an OfflinePlayer using an offline mode UUID since the name has no profile + profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name); + } -+ if (profile == null) { -+ throw new NullPointerException("Could not get UUID for Player " + name); ++ if (profile != null) { ++ this.profile = profile; + } -+ this.profile = profile; + } + + if (profile.getName() == null) { @@ -294,7 +293,7 @@ index 000000000..9ad5853de +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java new file mode 100644 -index 000000000..25836b975 +index 0000000000..25836b975b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java @@ -0,0 +0,0 @@ @@ -330,7 +329,7 @@ index 000000000..25836b975 +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java new file mode 100644 -index 000000000..3bcdb8f93 +index 0000000000..3bcdb8f93f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java @@ -0,0 +0,0 @@ @@ -353,7 +352,7 @@ index 000000000..3bcdb8f93 +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java new file mode 100644 -index 000000000..4b2a67423 +index 0000000000..4b2a67423f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java @@ -0,0 +0,0 @@ @@ -388,7 +387,7 @@ index 000000000..4b2a67423 +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java new file mode 100644 -index 000000000..3aceb0ea8 +index 0000000000..3aceb0ea8a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java @@ -0,0 +0,0 @@ @@ -404,7 +403,7 @@ index 000000000..3aceb0ea8 + } +} diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 02940d697..4539b5601 100644 +index 02940d697f..4539b56012 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +0,0 @@ @@ -429,7 +428,7 @@ index 02940d697..4539b5601 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e8bddc171..fcf6bac08 100644 +index e8bddc171c..fcf6bac08f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs @@ -450,7 +449,7 @@ index e8bddc171..fcf6bac08 100644 return this.W; } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 7ce08eb8b..6a750c25e 100644 +index 7ce08eb8bb..6a750c25eb 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java @@ -0,0 +0,0 @@ public class UserCache { @@ -486,7 +485,7 @@ index 7ce08eb8b..6a750c25e 100644 private UserCacheEntry(GameProfile gameprofile, Date date) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 77c16fe2c..2dd7ed96a 100644 +index 77c16fe2c4..2dd7ed96a4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;