Fix crash that somehow happened.

This commit is contained in:
Matthew Messinger 2016-05-20 00:03:40 -04:00
parent 71ac31819d
commit 16fd7ef973

View file

@ -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<String, String> data = new Gson().fromJson(json, new TypeToken<Map<String, String>>() {}.getType());
if (data == null)
return;
if (data.containsKey("race"))
metadata.setRace(PonyRace.valueOf(data.get("race")));
if (data.containsKey("tail"))