mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 01:27:40 +01:00
Fix NPE with custom join messages (#4334)
This fixes a bug in #4290 in which custom join messages would throw a NullPointerException if the user hasn't changed their username.
This commit is contained in:
parent
435ac80ff9
commit
0b6b0f9c61
@ -346,7 +346,7 @@ public class EssentialsPlayerListener implements Listener {
|
|||||||
.replace("{UPTIME}", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime()))
|
.replace("{UPTIME}", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime()))
|
||||||
.replace("{PREFIX}", FormatUtil.replaceFormat(ess.getPermissionsHandler().getPrefix(player)))
|
.replace("{PREFIX}", FormatUtil.replaceFormat(ess.getPermissionsHandler().getPrefix(player)))
|
||||||
.replace("{SUFFIX}", FormatUtil.replaceFormat(ess.getPermissionsHandler().getSuffix(player)))
|
.replace("{SUFFIX}", FormatUtil.replaceFormat(ess.getPermissionsHandler().getSuffix(player)))
|
||||||
.replace("{OLDUSERNAME}", lastAccountName);
|
.replace("{OLDUSERNAME}", lastAccountName == null ? "" : lastAccountName);
|
||||||
if (!msg.isEmpty()) {
|
if (!msg.isEmpty()) {
|
||||||
ess.getServer().broadcastMessage(msg);
|
ess.getServer().broadcastMessage(msg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user