SPIGOT-7882, #1467: Fix conversion of name in Profile Component to empty if it is missing

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot
2024-08-31 08:40:57 +10:00
parent b2a28c54bb
commit b133887b85
4 changed files with 85 additions and 66 deletions

View File

@@ -7,6 +7,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.UUID;
import net.minecraft.SystemUtils;
import net.minecraft.world.item.component.ResolvableProfile;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
@@ -90,7 +91,10 @@ public class PlayerProfileTest {
public void testGameProfileWrapping() {
// Invalid profiles:
assertThrows(NullPointerException.class, () -> {
new CraftPlayerProfile(null);
new CraftPlayerProfile((GameProfile) null);
});
assertThrows(NullPointerException.class, () -> {
new CraftPlayerProfile((ResolvableProfile) null);
});
// Valid profiles: