2
0
mirror of https://github.com/HMCL-dev/HMCL.git synced 2025-02-11 16:59:54 +08:00

fix(skin): NPE.

This commit is contained in:
huanghongxun 2021-10-05 18:32:14 +08:00
parent 27f6ff74fc
commit 9a46596b6c

View File

@ -145,7 +145,7 @@ public class YggdrasilServer extends HttpServer {
public Character(UUID uuid, String name, Skin.LoadedSkin skin) {
this.uuid = uuid;
this.name = name;
this.skin = Objects.requireNonNull(skin);
this.skin = skin;
}
public UUID getUUID() {
@ -162,10 +162,10 @@ public class YggdrasilServer extends HttpServer {
public Object toCompleteResponse(String rootUrl) {
Map<String, Object> realTextures = new HashMap<>();
if (skin.getSkin() != null) {
if (skin != null && skin.getSkin() != null) {
realTextures.put("SKIN", mapOf(pair("url", rootUrl + "/textures/" + skin.getSkin().getHash())));
}
if (skin.getCape() != null) {
if (skin != null && skin.getCape() != null) {
realTextures.put("CAPE", mapOf(pair("url", rootUrl + "/textures/" + skin.getSkin().getHash())));
}