From b211e314d143196d2a34671c116cb2d4ebf19e68 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Fri, 12 Feb 2021 13:46:33 -0500 Subject: [PATCH] Fix NPE with MOTD --- .../connector/network/ConnectorServerEventHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/connector/src/main/java/org/geysermc/connector/network/ConnectorServerEventHandler.java b/connector/src/main/java/org/geysermc/connector/network/ConnectorServerEventHandler.java index 87883087dfb..b4a0ddb696d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/ConnectorServerEventHandler.java +++ b/connector/src/main/java/org/geysermc/connector/network/ConnectorServerEventHandler.java @@ -95,6 +95,13 @@ public BedrockPong onQuery(InetSocketAddress inetSocketAddress) { pong.setMaximumPlayerCount(config.getMaxPlayers()); } + if (pong.getMotd() == null) { + pong.setMotd(""); + } + if (pong.getSubMotd() == null) { + pong.setSubMotd(""); + } + // The ping will not appear if the MOTD + sub-MOTD is of a certain length. // We don't know why, though byte[] motdArray = pong.getMotd().getBytes(StandardCharsets.UTF_8);