From e4cb5e024964ffd0dc38395f2be94e9e461e2a0a Mon Sep 17 00:00:00 2001 From: Rollczi Date: Sun, 13 Oct 2024 14:02:37 +0200 Subject: [PATCH] Hot fix offline player NPE. --- .../litecommands/bukkit/argument/OfflinePlayerArgument.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litecommands-bukkit/src/dev/rollczi/litecommands/bukkit/argument/OfflinePlayerArgument.java b/litecommands-bukkit/src/dev/rollczi/litecommands/bukkit/argument/OfflinePlayerArgument.java index 569b49888..ad91dd64e 100644 --- a/litecommands-bukkit/src/dev/rollczi/litecommands/bukkit/argument/OfflinePlayerArgument.java +++ b/litecommands-bukkit/src/dev/rollczi/litecommands/bukkit/argument/OfflinePlayerArgument.java @@ -35,7 +35,11 @@ public OfflinePlayerArgument(Server server, Plugin plugin, boolean enableThreadC // Server#getOfflinePlayers() can be blocking, so we don't want to call it every time for (OfflinePlayer offlinePlayer : server.getOfflinePlayers()) { - this.nicknames.add(offlinePlayer.getName()); + String name = offlinePlayer.getName(); + + if (name != null) { + this.nicknames.add(name); + } } // Save new joining player names so our suggestions are more wide