From 16fd7ef973d38ec1ecec0a7b8553086b757708ff Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Fri, 20 May 2016 00:03:40 -0400 Subject: [PATCH] Fix crash that somehow happened. --- src/main/java/com/brohoof/minelittlepony/Pony.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/brohoof/minelittlepony/Pony.java b/src/main/java/com/brohoof/minelittlepony/Pony.java index 1626617d..be49c565 100644 --- a/src/main/java/com/brohoof/minelittlepony/Pony.java +++ b/src/main/java/com/brohoof/minelittlepony/Pony.java @@ -72,12 +72,17 @@ public class Pony { } private void checkMeta(GameProfile profile) { - if (profile == null) - return; IWebPreferences prefs = WebPreferencesManager.getDefault().getPreferences(profile); + + if (prefs == null) + return; + String json = prefs.get(HDSkinManager.METADATA_KEY, "{}"); Map data = new Gson().fromJson(json, new TypeToken>() {}.getType()); + if (data == null) + return; + if (data.containsKey("race")) metadata.setRace(PonyRace.valueOf(data.get("race"))); if (data.containsKey("tail"))