Skip to content

Commit

Permalink
Fix NPE with custom join messages (#4334)
Browse files Browse the repository at this point in the history
This fixes a bug in #4290 in which custom join messages would throw a NullPointerException if the user hasn't changed their username.
  • Loading branch information
JRoy authored Jul 9, 2021
1 parent 435ac80 commit 0b6b0f9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public void run() {
.replace("{UPTIME}", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime()))
.replace("{PREFIX}", FormatUtil.replaceFormat(ess.getPermissionsHandler().getPrefix(player)))
.replace("{SUFFIX}", FormatUtil.replaceFormat(ess.getPermissionsHandler().getSuffix(player)))
.replace("{OLDUSERNAME}", lastAccountName);
.replace("{OLDUSERNAME}", lastAccountName == null ? "" : lastAccountName);
if (!msg.isEmpty()) {
ess.getServer().broadcastMessage(msg);
}
Expand Down

0 comments on commit 0b6b0f9

Please # to comment.