Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 00:23:03 +01:00
Fix rare NPE in skin handling code (#3357)
Dieser Commit ist enthalten in:
Ursprung
ece1b2a8ce
Commit
e8764c6a81
@ -258,8 +258,15 @@ public class SkinManager {
|
|||||||
JsonNode skinObject = GeyserImpl.JSON_MAPPER.readTree(new String(Base64.getDecoder().decode(encodedJson), StandardCharsets.UTF_8));
|
JsonNode skinObject = GeyserImpl.JSON_MAPPER.readTree(new String(Base64.getDecoder().decode(encodedJson), StandardCharsets.UTF_8));
|
||||||
JsonNode textures = skinObject.get("textures");
|
JsonNode textures = skinObject.get("textures");
|
||||||
|
|
||||||
if (textures != null) {
|
if (textures == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
JsonNode skinTexture = textures.get("SKIN");
|
JsonNode skinTexture = textures.get("SKIN");
|
||||||
|
if (skinTexture == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
String skinUrl = skinTexture.get("url").asText().replace("http://", "https://");
|
String skinUrl = skinTexture.get("url").asText().replace("http://", "https://");
|
||||||
|
|
||||||
boolean isAlex = skinTexture.has("metadata");
|
boolean isAlex = skinTexture.has("metadata");
|
||||||
@ -272,8 +279,6 @@ public class SkinManager {
|
|||||||
|
|
||||||
return new GameProfileData(skinUrl, capeUrl, isAlex);
|
return new GameProfileData(skinUrl, capeUrl, isAlex);
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return default skin with default cape when texture data is invalid, or the Bedrock player's skin if this
|
* @return default skin with default cape when texture data is invalid, or the Bedrock player's skin if this
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren