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
|
maven-version: 3.8.5
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: mvn --batch-mode test
|
run: mvn --batch-mode test -q
|
||||||
|
|
||||||
- name: Push to dokku
|
- name: Push to dokku
|
||||||
uses: dokku/github-action@master
|
uses: dokku/github-action@master
|
||||||
|
@ -47,7 +47,9 @@ public class PlayerController {
|
|||||||
if (player != null) { // The player exists
|
if (player != null) { // The player exists
|
||||||
Skin skin = player.getSkin();
|
Skin skin = player.getSkin();
|
||||||
Skin.Parts skinPart = Skin.Parts.fromName(part);
|
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
|
if (partBytes == null) { // Fallback to the default head
|
||||||
partBytes = PlayerUtils.getSkinPartBytes(Skin.DEFAULT_SKIN, Skin.Parts.HEAD, size);
|
partBytes = PlayerUtils.getSkinPartBytes(Skin.DEFAULT_SKIN, Skin.Parts.HEAD, size);
|
||||||
|
Loading…
Reference in New Issue
Block a user