Fix NPE introduced in #f4d977e

This commit is contained in:
Jishuna 2023-10-22 20:36:35 -04:00
parent 75502b6ddc
commit 224f733ac1
No known key found for this signature in database
GPG Key ID: 0497517C2A67E88E

View File

@ -142,7 +142,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
// SPIGOT-6558: Set initial textures // SPIGOT-6558: Set initial textures
tag.put(SKULL_OWNER.NBT, serializedProfile); tag.put(SKULL_OWNER.NBT, serializedProfile);
// Fill in textures // Fill in textures
PlayerProfile ownerProfile = getOwnerProfile(); PlayerProfile ownerProfile = new CraftPlayerProfile(profile); // getOwnerProfile may return null
if (ownerProfile.getTextures().isEmpty()) { if (ownerProfile.getTextures().isEmpty()) {
ownerProfile.update().thenAccept((filledProfile) -> { ownerProfile.update().thenAccept((filledProfile) -> {
setOwnerProfile(filledProfile); setOwnerProfile(filledProfile);