diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index de199cef..64086d51 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -118,10 +118,12 @@ public static MinecraftInstances.Instance create(Activity activity, String insta instances = GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); } catch (Exception e) { instances = new MinecraftInstances(); + instances.instances = new MinecraftInstances.Instance[0]; } if(instances == null) { instances = new MinecraftInstances(); + instances.instances = new MinecraftInstances.Instance[0]; GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); } @@ -144,9 +146,11 @@ public static MinecraftInstances load(String gameDir) { instances = GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); } catch (Exception e) { instances = new MinecraftInstances(); + instances.instances = new MinecraftInstances.Instance[0]; } if(instances == null) { instances = new MinecraftInstances(); + instances.instances = new MinecraftInstances.Instance[0]; GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); }