From 04a975009640eaa91774b4d2e90e709e7bd94fd9 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 29 Oct 2023 13:12:38 +0000 Subject: [PATCH] Fix ClientLoginNetworkAddon does not handle unsuccessful query responses Closes #3384 --- .../fabric/impl/networking/client/ClientLoginNetworkAddon.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientLoginNetworkAddon.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientLoginNetworkAddon.java index feb89ff09a..299179d413 100644 --- a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientLoginNetworkAddon.java +++ b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientLoginNetworkAddon.java @@ -88,7 +88,7 @@ private boolean handlePacket(int queryId, Identifier channelName, PacketByteBuf try { CompletableFuture<@Nullable PacketByteBuf> future = handler.receive(this.client, this.handler, buf, futureListeners::add); future.thenAccept(result -> { - LoginQueryResponseC2SPacket packet = new LoginQueryResponseC2SPacket(queryId, new PacketByteBufLoginQueryResponse(result)); + LoginQueryResponseC2SPacket packet = new LoginQueryResponseC2SPacket(queryId, result == null ? null : new PacketByteBufLoginQueryResponse(result)); GenericFutureListener> listener = null; for (GenericFutureListener> each : futureListeners) {