aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
index b28e290c..b4fce512 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
@@ -835,9 +835,20 @@ public class ProfileViewer {
return inventoryInfo;
}
+ public boolean checkIfValidJson(JsonElement element){
+ return element != null;
+ }
+
public JsonObject getBackpackData(JsonObject backpack_contents_json, JsonObject backpack_icons) {
JsonArray contents = new JsonArray();
+ if(!(checkIfValidJson(backpack_contents_json) && checkIfValidJson(backpack_icons))){
+ JsonObject bundledReturn = new JsonObject();
+ bundledReturn.add("contents", new JsonArray());
+ bundledReturn.add("backpack_sizes", new JsonArray());
+
+ return bundledReturn;
+ }
String[] backpackArray = new String[0];