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:
parent
6cd7ad0901
commit
661b14bd6e
1 changed files with 1 additions and 3 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue