aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorLulonaut <67191924+Lulonaut@users.noreply.github.com>2022-07-29 10:28:08 +0200
committerGitHub <noreply@github.com>2022-07-29 10:28:08 +0200
commitc27583484181a9829d515a1984654fdd7554aa00 (patch)
tree33ef8b038770588900630632f59d2513f7f449e7 /src/main/java
parent5bcf7cc19df3ff59385b1de06cc3e2e827f5e2b6 (diff)
downloadNotEnoughUpdates-c27583484181a9829d515a1984654fdd7554aa00.tar.gz
NotEnoughUpdates-c27583484181a9829d515a1984654fdd7554aa00.tar.bz2
NotEnoughUpdates-c27583484181a9829d515a1984654fdd7554aa00.zip
fix essence parsing on items that don't need other items (#195)
Diffstat (limited to 'src/main/java')
-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 (