1
0
Fork 0
mirror of https://github.com/xHyroM/lighteco.git synced 2024-11-23 07:21:04 +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) {
LightEcoPlugin plugin = context.getSource().plugin();
String remaining = builder.getRemaining();
for (UUID uniqueId : plugin.getBootstrap().getOnlinePlayers()) {
User user = plugin.getUserManager().getIfLoaded(uniqueId);
if (user == null) continue;
if (user == null || user.getUsername() == null) continue;
builder.suggest(user.getUsername());
}