mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Fix crash that somehow happened.
This commit is contained in:
parent
71ac31819d
commit
16fd7ef973
1 changed files with 7 additions and 2 deletions
|
@ -72,12 +72,17 @@ public class Pony {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkMeta(GameProfile profile) {
|
private void checkMeta(GameProfile profile) {
|
||||||
if (profile == null)
|
|
||||||
return;
|
|
||||||
IWebPreferences prefs = WebPreferencesManager.getDefault().getPreferences(profile);
|
IWebPreferences prefs = WebPreferencesManager.getDefault().getPreferences(profile);
|
||||||
|
|
||||||
|
if (prefs == null)
|
||||||
|
return;
|
||||||
|
|
||||||
String json = prefs.get(HDSkinManager.METADATA_KEY, "{}");
|
String json = prefs.get(HDSkinManager.METADATA_KEY, "{}");
|
||||||
Map<String, String> data = new Gson().fromJson(json, new TypeToken<Map<String, String>>() {}.getType());
|
Map<String, String> data = new Gson().fromJson(json, new TypeToken<Map<String, String>>() {}.getType());
|
||||||
|
|
||||||
|
if (data == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (data.containsKey("race"))
|
if (data.containsKey("race"))
|
||||||
metadata.setRace(PonyRace.valueOf(data.get("race")));
|
metadata.setRace(PonyRace.valueOf(data.get("race")));
|
||||||
if (data.containsKey("tail"))
|
if (data.containsKey("tail"))
|
||||||
|
|
Loading…
Reference in a new issue