fix error if bad part name is given
Some checks failed
deploy / deploy (push) Failing after 37s

This commit is contained in:
Lee 2024-04-08 07:33:14 +01:00
parent 33d966057f
commit 88da585d47
2 changed files with 4 additions and 2 deletions

@ -22,7 +22,7 @@ jobs:
maven-version: 3.8.5
- name: Run Tests
run: mvn --batch-mode test
run: mvn --batch-mode test -q
- name: Push to dokku
uses: dokku/github-action@master

@ -47,8 +47,10 @@ public class PlayerController {
if (player != null) { // The player exists
Skin skin = player.getSkin();
Skin.Parts skinPart = Skin.Parts.fromName(part);
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);
}