Skip to content

Commit

Permalink
Fix NPE with MOTD (GeyserMC#1921)
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed Feb 12, 2021
1 parent 25dd651 commit 98b2a0e
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 98b2a0e

Please sign in to comment.