forked from MinecraftUtilities/Backend
fix error if bad part name is given
This commit is contained in:
@ -47,7 +47,9 @@ public class PlayerController {
|
||||
if (player != null) { // The player exists
|
||||
Skin skin = player.getSkin();
|
||||
Skin.Parts skinPart = Skin.Parts.fromName(part);
|
||||
partBytes = PlayerUtils.getSkinPartBytes(skin, skinPart, size);
|
||||
if (skinPart != null) { // The part exists
|
||||
partBytes = PlayerUtils.getSkinPartBytes(skin, skinPart, size);
|
||||
}
|
||||
}
|
||||
if (partBytes == null) { // Fallback to the default head
|
||||
partBytes = PlayerUtils.getSkinPartBytes(Skin.DEFAULT_SKIN, Skin.Parts.HEAD, size);
|
||||
|
Reference in New Issue
Block a user