From 661b14bd6e2daf8713e57a0c74beeb7812c3c31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Steinh=C3=BCbl?= Date: Thu, 21 Nov 2024 23:53:33 +0100 Subject: [PATCH] fix: skip on invalid username --- .../suggestion/type/OfflineUserSuggestionProvider.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/src/main/java/dev/xhyrom/lighteco/common/command/suggestion/type/OfflineUserSuggestionProvider.java b/common/src/main/java/dev/xhyrom/lighteco/common/command/suggestion/type/OfflineUserSuggestionProvider.java index cef1398..be9a802 100644 --- a/common/src/main/java/dev/xhyrom/lighteco/common/command/suggestion/type/OfflineUserSuggestionProvider.java +++ b/common/src/main/java/dev/xhyrom/lighteco/common/command/suggestion/type/OfflineUserSuggestionProvider.java @@ -22,11 +22,9 @@ public class OfflineUserSuggestionProvider implements SuggestionProvider 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()); }