diff --git a/bukkit/src/main/java/org/popcraft/bolt/util/Profiles.java b/bukkit/src/main/java/org/popcraft/bolt/util/Profiles.java index abdfff02..f2591775 100644 --- a/bukkit/src/main/java/org/popcraft/bolt/util/Profiles.java +++ b/bukkit/src/main/java/org/popcraft/bolt/util/Profiles.java @@ -51,7 +51,12 @@ public static CompletableFuture lookupProfileByName(final String name) if (name == null || name.isEmpty() || NIL_UUID_STRING.equals(name) || name.length() > MAX_NAME_LENGTH || KNOWN_NULL_LOOKUPS_BY_NAME.contains(name)) { return CompletableFuture.completedFuture(SimpleProfileCache.EMPTY_PROFILE); } - final PlayerProfile playerProfile = Bukkit.createPlayerProfile(name); + final PlayerProfile playerProfile; + try { + playerProfile = Bukkit.createPlayerProfile(name); + } catch (final IllegalArgumentException ignored) { + return CompletableFuture.completedFuture(SimpleProfileCache.EMPTY_PROFILE); + } final CompletableFuture updatedProfile = playerProfile.update(); final ProfileCache profileCache = JavaPlugin.getPlugin(BoltPlugin.class).getProfileCache(); updatedProfile.thenAccept(profile -> { @@ -98,7 +103,12 @@ public static CompletableFuture lookupProfileByUniqueId(final UUID uuid if (uuid == null || NIL_UUID.equals(uuid) || KNOWN_NULL_LOOKUPS_BY_UUID.contains(uuid)) { return CompletableFuture.completedFuture(SimpleProfileCache.EMPTY_PROFILE); } - final PlayerProfile playerProfile = Bukkit.createPlayerProfile(uuid); + final PlayerProfile playerProfile; + try { + playerProfile = Bukkit.createPlayerProfile(uuid); + } catch (final IllegalArgumentException ignored) { + return CompletableFuture.completedFuture(SimpleProfileCache.EMPTY_PROFILE); + } final CompletableFuture updatedProfile = playerProfile.update(); final ProfileCache profileCache = JavaPlugin.getPlugin(BoltPlugin.class).getProfileCache(); updatedProfile.thenAccept(profile -> {