diff options
author | Lulonaut <67191924+Lulonaut@users.noreply.github.com> | 2022-07-29 10:28:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 10:28:08 +0200 |
commit | c27583484181a9829d515a1984654fdd7554aa00 (patch) | |
tree | 33ef8b038770588900630632f59d2513f7f449e7 | |
parent | 5bcf7cc19df3ff59385b1de06cc3e2e827f5e2b6 (diff) | |
download | NotEnoughUpdates-c27583484181a9829d515a1984654fdd7554aa00.tar.gz NotEnoughUpdates-c27583484181a9829d515a1984654fdd7554aa00.tar.bz2 NotEnoughUpdates-c27583484181a9829d515a1984654fdd7554aa00.zip |
fix essence parsing on items that don't need other items (#195)
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java | 8 |
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 ( |