forked from MinecraftUtilities/Backend
fix error if bad part name is given
This commit is contained in:
parent
33d966057f
commit
88da585d47
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user