From 1bb4fa735d248de9a9402b169e551a0a0bd03700 Mon Sep 17 00:00:00 2001 From: Mariell Date: Sat, 20 Jun 2020 20:46:57 +0200 Subject: [PATCH] Only complete from cache if ID is given (#3591) As it stands, one can complete from the cache if no ID is given. If there is no ID, it will throw an NPE, as ConcurrentHashMap (which is used in UserCache) does not support null keys. This should fix any current and future issues where exceptions are thrown just because a UUID is not currently given on the profile due to a plugin or server bug/issue. Fixes #3590. --- Spigot-Server-Patches/Basic-PlayerProfile-API.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch index 5081a979bc..3e606e69bb 100644 --- a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch @@ -170,7 +170,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + -+ if (profile.getName() == null || !hasTextures()) { ++ if ((profile.getName() == null || !hasTextures()) && profile.getId() != null) { + GameProfile profile = userCache.getProfile(this.profile.getId()); + if (profile != null) { + // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't