mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Don't throw errors when loading chunks with invalid skulls (#4081)
* Don't throw errors with invalid skulls * Move IllegalArgumentException check to loadFromJson() method
This commit is contained in:
parent
9ddfdf9374
commit
90c4ea78a7
1 changed files with 8 additions and 1 deletions
|
@ -278,7 +278,14 @@ public class SkinManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GameProfileData loadFromJson(String encodedJson) throws IOException, IllegalArgumentException {
|
public static GameProfileData loadFromJson(String encodedJson) throws IOException, IllegalArgumentException {
|
||||||
JsonNode skinObject = GeyserImpl.JSON_MAPPER.readTree(new String(Base64.getDecoder().decode(encodedJson), StandardCharsets.UTF_8));
|
JsonNode skinObject;
|
||||||
|
try {
|
||||||
|
skinObject = GeyserImpl.JSON_MAPPER.readTree(new String(Base64.getDecoder().decode(encodedJson), StandardCharsets.UTF_8));
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
GeyserImpl.getInstance().getLogger().debug("Invalid base64 encoded skin entry: " + encodedJson);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
JsonNode textures = skinObject.get("textures");
|
JsonNode textures = skinObject.get("textures");
|
||||||
|
|
||||||
if (textures == null) {
|
if (textures == null) {
|
||||||
|
|
Loading…
Reference in a new issue