From 9df545483c0fd8f09bfdce24e22c4f9fb378d959 Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Thu, 25 Jun 2020 11:28:30 -0300 Subject: [PATCH] Fix when client doesn't have id --- .../myles/ViaVersion/api/platform/ViaConnectionManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/api/platform/ViaConnectionManager.java b/common/src/main/java/us/myles/ViaVersion/api/platform/ViaConnectionManager.java index a09825fa2..e263f2bcb 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/platform/ViaConnectionManager.java +++ b/common/src/main/java/us/myles/ViaVersion/api/platform/ViaConnectionManager.java @@ -59,7 +59,7 @@ public class ViaConnectionManager { /** * Returns the UUID from the frontend connection to this proxy server - * Returns null when there isn't a server or frontend id was not found + * Returns null when there isn't a server or this connection isn't frontend or it doesn't have an id * When ViaVersion is reloaded, this method may not return some players. * May not return ProtocolSupport players. *
@@ -70,7 +70,8 @@ public class ViaConnectionManager { public UUID getConnectedClientId(UserConnection conn) { if (conn.getProtocolInfo() == null) return null; UUID uuid = conn.getProtocolInfo().getUuid(); - if (clients.get(uuid).equals(conn)) { + UserConnection client = clients.get(uuid); + if (client != null && client.equals(conn)) { // This is frontend return uuid; }