1
0
Fork 0
mirror of https://github.com/xHyroM/lighteco.git synced 2024-11-23 15:21:06 +01:00

fix: skip on invalid username

This commit is contained in:
Jozef Steinhübl 2024-11-21 23:53:33 +01:00
parent 6cd7ad0901
commit 661b14bd6e
No known key found for this signature in database
GPG key ID: E6BC90C91973B08F

View file

@ -22,11 +22,9 @@ public class OfflineUserSuggestionProvider implements SuggestionProvider<Command
CommandContext<CommandSource> context, SuggestionsBuilder builder) { CommandContext<CommandSource> context, SuggestionsBuilder builder) {
LightEcoPlugin plugin = context.getSource().plugin(); LightEcoPlugin plugin = context.getSource().plugin();
String remaining = builder.getRemaining();
for (UUID uniqueId : plugin.getBootstrap().getOnlinePlayers()) { for (UUID uniqueId : plugin.getBootstrap().getOnlinePlayers()) {
User user = plugin.getUserManager().getIfLoaded(uniqueId); User user = plugin.getUserManager().getIfLoaded(uniqueId);
if (user == null) continue; if (user == null || user.getUsername() == null) continue;
builder.suggest(user.getUsername()); builder.suggest(user.getUsername());
} }