aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
index 794282f1..0c3f592b 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
@@ -1173,9 +1173,11 @@ public class RenderListener {
}
}
}
- JsonObject itemsObj = jsonObject.get(id).getAsJsonObject().get("items").getAsJsonObject();
- jsonObject.get(id).getAsJsonObject().remove("items");
- jsonObject.get(id).getAsJsonObject().add("items", itemsObj);
+ if (jsonObject.get(id).getAsJsonObject().has("items")) {
+ JsonObject itemsObj = jsonObject.get(id).getAsJsonObject().get("items").getAsJsonObject();
+ jsonObject.get(id).getAsJsonObject().remove("items");
+ jsonObject.get(id).getAsJsonObject().add("items", itemsObj);
+ }
Gson gson = new GsonBuilder().setPrettyPrinting().create();
try {
try (